Everything For Electronics

February 2005

WWW. nuteVolte . oorA

0/0/0/.

Executing 65,000 lines of Basic code per second the BasicX-24 is the KING of Basic programmable microcontrollers.

400 bytes RAM.

32K User program area.

19 I/O lines'with 8 lOBit ADC’s.

Real multitasking and Serial UARTs.

^^=jyyy

a/a/a/.^r/

Siteplayer is a true stand

mini web server.

Super easy to use.

Standard RJ-45 network interface.

Control or monitor anything over the web.

7~ y /•■afrV

a/ u/ a/. ^/7^/zrA^ com

High quality serial 2x16 LCD with backlight

Easy to use.

2400 & 9600 Baud support Software controllable backlight and contrast

M , TM

-^E7CTO=?/_Z_Z ZZ7

ujt-v //

Mini Workstation

Wonder!

Small-footprint 1 33 MHz barebone system

Tiny size, big features! 9” x 1 1 .5” x 2” case

Fan-cooled Cyrix processor

On-board floppy & IDE controllers

On-board SIO, PIO, lObase-T, SVGA

One ISA slot (horizontal, with riser)

Room for 3.5” floppy, 3.5” HD (not incl.)

Holds up to 64MB RAM EDO (not incl.)

60-watt power supply, line cord included

HSC 90-day warranty

HSC#20442

$24.95

Wireless Video System!

Tiny 3/4 in. color camera w/transmitter!

Receiver is tuneable for best signal

9VDC batt. conn, for portable camera

AC power packs for both units!

RCA plugs for A N out,

‘F’ conn for whip.

New, 90-day warranty

HSC#80748 $59.95!

CompactPCI® Enclosure Package!

CG Mupac’s ‘535 Series’

19” rackmntable9U cabinet |

3-350W hot-swappable front-pull power supplies

21 -slot 6U x 160mm front &6U x 80mm rear IEEE1 101 .10/1 101 .1 1 Compliant CompactPCI subracks

Hot-pluggablefan tray w/2 141 CFM top-mntd blowers, bottom blowers also

Two front-pull drawers for SCA-type SCSI hard disk drives

Bonus! ’Force’ “X86” plug-in included at no extra charge!! Complete ‘X86’ computer, 233 MHz, w/VGA, PIO, SIO, USB, lOBaseT and floppy disk drive!!

Unused - removed from installation

DVI Cable Deal!

DVI-I Digital & Analog, Single-link cable

Male-to-Male

Black, 8 ft. long

Super price!

New in bag

HSC 90-day warr.

HSC#20346

$9.95

Color Touch Screen!

ALPSLFH8P4032E

4-wire touchscreen intfce.

240x320 diag. LCD STN display w/CCFL backlight (no inverter incl.)

2.75” x 3.50” x 0.375” Special!...2/$59.95!

For info, see http://hubbard.engr.scu.edu/ embedded/lcd/lfh8p4032b/lfh8p4032b.html

HSC#19827 $39.95

Ultrasonic Range Sensor \

Similar to SonaSwitch ‘Mini-S’

Mounts in 1 .575” hole!!

Fixed range: 5-7 feet.

Rep. sense rate: 10Hz

See http://www.halted.com for tech info

HSC 90-day warranty

Hobbyist Alert LEDs on the Web!

HSC#19833

$9.95 1

HSC Exclusive PixieU

I Tiny QRPXcvr rig! 200-300 mW out

Kit incl. all board-mounted parts

Use ‘walkman’ phones

QRP crystal pack special!

Finally!!. ..40, 30, 20, 17, 15 &

10 meter calling freqs. in one bag!

HSC#crystalpak $14.95 | HSC#Pixie2 $9.95

Ethernet Xceiver!

I MT -RJ 850nm VCSEL 2x5 T ranceiver,

| IEEE802.3Z, 1 000BASE-SX, 1 .0625/

1.25 Gbps

(♦Channel class: 100-M5 SN1 , 100-M6-SN1 I Class I laser safety with- out OFC circuit | ♦Single +3. 3VDC operation,

< 0.6W PwrDis

Here is a sample of the way our website is growing... have a look at some of the LEDs we offer! From time to time, we will show you some of our vast inventory here in this ad, but if you want to see more, gotoWWW.HALTED.COM for the full story... we are uploading all the time! LED, Blue, Round T-1 3/4 (5mm), 150mcd LED, Green, Rectangular (2x5mm)

LED, Green, Round Jumbo (1 0mm)

LED, Green, Round T-1 (3mm)

LED, Green, Round T-1 3/4 (5mm)

LED, Green/Blinking, Round T-1 3/4 (5mm)

LED, Infared, Round T 1-3/4 (5mm)

LED, Red, Rectangular (2x5mm)

LED, Red, Round Jumbo (10mm)

LED, Red, Round T-1 (3mm)

LED, Red, Round T-1 3/4 (5mm)

LED, Red/Blinking, Round Jumbo (10mm)

LED, Red/Blinking, Round T-1 3/4 (5mm)

LED, Red/Green Bi-Color, Round T-1 3/4 (5mm)

LED, Red/Green/Blue, T 1-3/4 (5mm), Clear LED, Red/Green/Blue, T 1-3/4 (5mm), White LED, Superbright Blue, 5500mcd, 15 Deg View LED, Superbright Green, 5000mcd, 30 Deg View LED, Superbright Red, 8000mcd, 30 Deg View LED, Superbright White, 6000mcd, 18 Deg View LED, Superbright Yellow, 5000mcd, 30 Deg Vie'

LED, Ultraviolet, 2000mcd, 30 Deg View Angle LED, White, Round T 1-3/4 (5mm), 850mcd LED, Yellow, Rectangular (2x5mm)

LED, Yellow, Round Jumbo (10mm)

LED, Yellow, Round T-1 (3mm)

LED, Yellow, Round T-1 3/4 (5mm)

LED, Yellow/Blinking, Round T-1 3/4 (5mm)

Hobbyist Alert #2 - transformers too!

...and here is another reason to check out WWW.HALTED.COM... transformers and AC I Adaptors are available now! Keep checking back as we get more inventory posted.

Isolation transformer, 1 000 watt, 4-outlet cir brkr T ransformer, 1 0OOw stepup/stepdown *8x7x6 T ransformer, 200w stepup/stepdown *5x4x3* T ransformer, 500w stepup/stepdown *7x5x4* Transformer, 12vct, 1 amp Transformer, 12vct, 3 amp Transformer, 12vct, 500ma Transformer, 18vct, 1 amp Transformer, 24 vet, 1 amp Variable transformer, 1 000 watt Variable transformer, 500 watt

LED001

$2.75

LED005

.15

LED003

.40

LED022

.12

LED019

.12

LED004

.70

LED032

.39

LED011

.15

LED008

.40

LED023

.10

LED021

.10

LED009

1.25

LED010

.65

LED002

.35

LED034

2.89

LED035

2.89

LED027

1.85

LED026

1.60

LED028

.85

LED030

2.25

LED029

.85

LED031

2.80

LED006

2.49

LED015

.15

LED036

.40

LED024

.12

LED020

.12

LED014

.75

TRI038

$174.00

PH 1306

59.95

PH 1080

18.95

PHI147

36.95

PAL063

7.95

CAL065

12.49

CAL064

5.95

CAL058

9.95

CAL012

12.95

EQU005

94.95

EQU011

44.95

Dot Matrix Display

#19429 $8.00

Special Bargains!!

HSC#20249 $295.00 BhSC#20273 $29.95!

System Accessories

Force CPCI-680 CPU, 450MHz, 128MB

Fast/Wide SCSI , Linux compatible

Universal Mode PCI-PCI Bridge

HSC# 20426 $195.00!

Extra plug in 350W switching power supply, incl. CPCI-3500-P-38

Power Supply $125.00!

Power Supplies!

I ’Potrans’ Mod. No. PP-303X 300W, Std. ATX

HSC#20190

$14.95

Neon Light for PC, Sound Activated!

#20441 $9.95

Laptop Floppy Drive

HSC#20180 $14.95

Socket IV

>0217 I

£

12VDC Adapt., 3.4A

HSC#19312 $9.95

33.6k Socket Modem

HSC#20217 $4.95!

Internet TV Appliance

#20027 $29.95!

Cordless USB Adap

#19738 $6.00!

80W Power Supply

#18415 $5.00

’Power Computing’ Mod. No.TCX-20D

200W, Std . ATX

HSC#19721

$12.50

VideoWAVE Editor

#19656 $9.95!

Digital Multimeter

#AEEC1 504 $14.95!

Cordless LAN Card

#19737 $6.00!

‘Mylex’ RAID Card New Price!

#19427 $15.00!

1 50W Power Supply

#19266 $8.00

Cabinet, Rack 1U #19437 $9.00!

LCD Dot Matrix Display 2 x 40 char. Sharp #20298 $9.50 200W Power Supply

#19267 $10.00

Electronic w Supply

You can get more info about any of these items on our website!

Since 1963!...

"

r Silicon Valley’s Electronic Marketplace

3 Retail/Wholesale Locations:

Main Office - Mail Orders...

3500 Ryder St. Santa Clara, CA 95051 Santa Clara 1 -408-732-1 573

Sacramento 1-916-338-2545

Rohnert Park 1 -707-585-7344

Look for us on...

seller ID:

hscelectronicsupply

Order Toll-Free: 1 -800-4-HALTED(442-5833) or.. .ONLINE, AT: www.halted.com

Terms: Some quantities limited; all items are subject to prior sale. Minimum order: $1 0.00 plus shipping. Orders under $30.00 subject to $3.00 handling fee, in addition to shipping. All orders shipped by UPS Surface unless otherwise specified. $6.00 UPS charge added for COD. Visit our website for detailed information on domestic and international shipping methods.

FEBRUARY 2005

Circle #73 on the Reader Service Card.

■imm up ®iMM§

Vol. 26 No. 2

PROJECTS and FEATURES COLUMNS

30 THE WART REMOVER

Spare yourself the doctor visit.

by Thomas Scarborough

36 THE AVR HYPERTERM

Could it get any smaller?

by G.Y.Xu

44 STAMP PONG

Hobbyists wax nostalgic with this retro game.

by Donald Bartley

56 CONFIDENTLY USING

INTERRUPTS WITH MCUs

Inside the enigmatic interrupt.

by Phil Mass

62 PID CONTROLLER, PART 2

A complete analog PID system.

by Aaron Dahlen

69 PLCs, PART I

Ladder logic and monitoring your PLC.

by David Ward

8 STAMP

Explore the learning and fun of experimenting.

14 TECHKNOWLEDGEY 2005

Practical nuclear fusion; pocket PCs; active ethernet; and more.

1 8 PERSONAL ROBOTICS

Get the 4 1 I on Basic languages for your robotics programming.

24 Q&A

Coil winding formulas; fan controllers; plant water monitors; and more.

FEBRUARY 2005

ROBOTICS MICROCONTROLLERS COMPUTER CONTROL SPACE

Exploring the Enigmatic li^errupt

Ham It Up!

The Basics of Basic

Nuts & Volts (ISSN 1 528-9885/CDN Pub Agree#40702530) is published monthly for $24.95 per year by T & L Publications, Inc., 430 Princeland Court, Corona, CA 92879. PERIODICALS POSTAGE PAID AT CORONA, CA AND AT ADDITIONAL MAILING OFFICES. POSTMASTER: Send address changes to

Nuts & Volts, 430 Princeland Court, Corona, CA 92879-1300 or Station A, RO. Box 54,

Windsor ON N9A 6J5; cpcreturns@nutsvolts.com

4

75

80

85

89

JUST FOR STARTERS

Keep your circuits cool.

DESIGN CYCLE

Mastering DSP.

OPEN COMMUNICATION

Reviving your inner ham.

IN THE TRENCHES

Quality and the engineer.

DEPARTMENTS

Advertiser’s Index 52 Classified Display Ads

22 Electro-Net

29 Electronics Showcase

50 New Product News

54 News Bytes

NV Bookstore Publisher’s Info Reader Feedback 94 Tech Forum

FEBRUARY 2005

PCB123 Provides the Complete Circuit Board Solution, Design Through Order

New / Enhanced Features:

13626 S Freeman Rd. Mulino, OR 97042 USA DOWNLOAD THE NEW VERSION

Phone: (800) 228-8198 x236 / Fax: (503) 829-6657 @ WWW.pcbl 23.COm

YOUR FOR PROTOTYPE CIRCUIT

BOARbS

Save

iesign

lies?

CIRCUi*

Successfully selling online since 1997. Experience you can trust! Try us out today at:

www.PCBexpress.com/nv

PCB123 is a FREE layout and schematic design software tool that quotes your board while you design!

Import Net lists from multiple CAD vendors 145,000+ parts library 2, 4, and 6 layer support Fast, accurate DRC

Copper pour with net connectivity -> Fine pitch autorouter with fanout

Nufs~& Volts

Reader Feedback

^ SB

Dear Nuts & Volts:

I just read the “Garage Parking Assistant” project by Dave Siegel in the December Nuts & Volts. While this solution sounds good, it does require a newer garage door opener with a light beam sensor.

My opener is of the older type without sensors and, some time ago, I came up with a "lower tech" solution that has been working fine for me.

The basis for my system utilizes the light circuit that is built into the opener’s motor box. I modified an inexpensive, hand-held laser pointer by bypassing the push- button switch so that it will always be on whenever power is applied. I then removed the batteries (two AAA cells, in my case) and permanently wired in a 3 volt DC wall wart power supply.

I mounted the modified laser and pointed it to an aluminum rod fastened to the opener motor box so that it pointed straight down. I then removed one of the two light bulbs in the opener motor box, screwed in a plug adapter, and plugged the wall wart into the adapter.

When the opener is activated, the remaining light bulb and laser pointer comes on and stays

on for about two minutes. The laser pointer is aimed so that, when the red dot hits the middle of the dashboard, the car is in the proper position.

For any given system, it may be necessary to mount the laser pointer in a different manner and it will take a little trial and error to get it aimed to suit the driver.

Jerry Cobb Oklahoma City, OK

Dear Nuts & Volts:

I have a comment regarding the November 2004 “Q&A” section called "Heart Rate Monitor.”

I, too, am on the lookout for an easy-to-implement way of recording a heart rate. Only, I'm interested in recording (or processing) the real ECG-signal. (The product T.J. Byers mentioned does not measure the ECG signal, but detects the pulse, which is not the same, technically.) So, I’m still interested in an ECG project.

Also I must strongly contradict T.J.’s view: Practically everything I could think of to build as a project can be bought for much less somewhere.

That's our fate as hobbyists.

Christoph Klein via Internet

by J. Shuman

Do -It- yov<\srLFER?

u HAT WAS I THIWKI WcrfJ

You A "SOME ASSEMBLY Req.u\AED,j Ta/sTrocTio^ Manual

BooK owe

Published Monthly By

T & L Publications, Inc.

430 Princeland Ct., Corona, CA 92879- 1 300

(951) 371-8497 FAX (951) 371-3052 www.nutsvolts.com

Subscription OrderONLY Line

1-800-783-4624

FOUNDER/ASSOCIATE PUBLISHER

Jack Lemieux

PUBLISHER

Larry Lemieux

publisher@nutsvolts.com

ASSOCIATE PUBLISHER/

VP OF SALES/MARKETING

Robin Lemieux

robin@nutsvolts.com

MANAGING EDITOR

Alexandra Lindstrom

alexa@nutsvolts.com

CONTRIBUTING EDITORS

Gerard Fonte Peter Best Jeff Eckert Mark Balch Gerard Fonte Thomas Scarborough Phil Mass

TJ Byers Jon Williams Mike Keesling Louis Frenzel Donald Bartley G.Y.Xu Aaron Dahlen

David Ward

CIRCULATION DIRECTOR

Mary Descaro

subscribe@nutsvolts.com

SHOW COORDINATOR

Audrey Lemieux

WEB CONTENT/NV STORE

Michael Kaudze

michael@nutsvolts.com

COVER ART

Michele Durant

PRODUCTION/GRAPHICS

Shannon Lemieux

STAFF

Kristan Rutz Dawn Saladino

Copyright 2005 by T & L Publications, Inc.

All Rights Reserved

All advertising is subject to publisher's approval. We are not responsible for mistakes, misprints, or typographical errors. Nuts & Volts Magazine assumes no responsibility for the availability or condition of advertised items or for the honesty of the advertiser. The publisher makes no claims for the legality of any item advertised in Nuts & Volts. This is the sole responsibility of the advertiser. Advertisers and their agencies agree to indemnify and protect the publisher from any and all claims, action, or expense arising from advertising placed in Nuts & Volts. Please send all subscription orders, correspondence, UPS, overnight mail, and artwork to: 430 Princeland Court, Corona, CA 92879.

6

FEBRUARY 2005

Get Your FREE US$ Priced Catalog - all 424 pages!

Just fill out the catalog request form at www.jaycarelectronics.com/catalog

Check our website!

All of our 6,000+ products with search facilities.

128-bit secure on-line ordering - safe & secure.

Over 3,500 product datasheets & application notes.

And we're from Australia, so you can trust us!

Postage and Packing includes airmail to the USA, and is $7.50 for orders up to $49.99. See our website for all freight charges.

Moreinfo?

www.jaycarelectronics.com

JUST ONE OF OUR MANY GREAT PRE-BUILT & TESTED CONSUMER PRODUCTS!

Performance Electronics for Cars Book

BS-5080 $13.60 plus post & packing

Australia's leading electronics magazine, Silicon Chip, has developed a range of projects for performance cars. There are 16 projects in total, ranging from devices for remapping fuel curves, to nitrous controllers, and more! The book includes all instructions, components lists, colour pictures, and circuit layouts. There are also chapters on engine management, advanced systems, DIY modifications, and more. Over 150 pages! All of the projects described are available in kit form, exclusively from Jaycar. Check out our website for all the details.

Theremin Synthesiser Kit

KC-5295 $34.95 plus post & packing

Map Reading Made Easy!

XC-0375 $11.95 plus post & packing The digital map distance calculator is truly a great device.

All you have to do is program the scale of your map, then roll the wheel tip along the intended route.

It will then display the ACTUAL REAL WORLD DISTANCE in miles

(or kilometres) on the LCD. It is light and compact at around 5-inches long.

The Theremin

is a weird musical instrument that was invented early last century but is still used today.

The Beach Boys' classic hit "Good Vibrations" featured a Theremin.

Kit includes a machined, silk-screened, and pre-drilled case, circuit board, all electronic components, and clear English instructions.

This product is also available pre-built and fully tested - Cat. AM-4025 $64.95

50MHz Frequency Meter Kit with LCD Display

KC-5369 $49.95 plus post & packing If you want a great value frequency meter, then this project is for you.

It features autoranging operation for ease of use, switching between its three ranges. High resolution of 0.1 Hz up to 150Hz, 1 Hz between 150Hz and 16MHz, and 10Hz above 16MHz. It can be powered by a 9V battery or wall adaptor | (not included) and the case measures just 5 1/8" x 2 5/8" x 1 ". Kit includes laser cut & silk screened case, circuit board, electronic components, & clear English instructions.

Fuel Mixture Display Kit for Cars

KC-5195 $8.65 plus post & packing $ ^

We Stock...

Electronic Components

Electronic Project Kits

Test & Measurement Equipment

Power Products and Accessories

Using this simple kit will give you / \

a good indication of how rich or v y'in* lean your car's engine is running.

It uses the factory ' j Q

EGO (exhaust, gas, O?

oxygen) sensor to - QBlfiiE

indicate the fuel

mixture on a series

of LEDs. If your engine

does not have an EGO sensor, one can be obtained from an automotive junk yard. Kit includes circuit board, all electronic components, and clear English instructions.

10 Amp 12VDC Motor Speed Controller Kit

KC-5225 $17.95 plus post & packing This project allows you to take control of DC motors, or dim incandescent lights. Control the speed of a fuel injection or water pump on your car, and a whole lot more. With the components supplied, it can handle up to 10 amps. By fitting an optional extra MOSFET transistor, it can handle up to 20 amps. Kit includes circuit board, all electronic components, and clear English instructions. Optional extra MOSFET transistor - ZT-2450 $3.90.

Audio & Video Equipment & Accessories

Computer & Telecoms Accessories

Security & Surveillance Equipment

Explanation

Indicates an

approximate /JTjV construction time for each project for a competent constructor. It does not how- ever, include any installation etc that may be required.

of icons used for kits

Straightforward to assemble,

I generally built in one session. Requires basic electronics and simple soldering skills.

Requires a good knowledge of electronics to understand its ^■3 operation, and troubleshooting detailed techniques may be required.

jnycnr

Log on to

www.jaycarelectronics.com/catalog

for your FREE catalog!

1-800-784-0263

(Monday - Friday 09.00 to 17.30 GMT + 10 hours only). For those that want to write: 100 Silverwater Rd Silverwater NSW 2128 Sydney AUSTRALIA

V

Stamp

by Jon Williams

Putting the Spotlight on BASIC Stamp Projects, Hints, and Tips

Stamp Applications

The Sheer Joy of Experimenting

For as long as I can remember, I’ve been interested in electricity and electronics. My first “way cool” experiment happened when I was in the second grade: I (correctly) deduced that a fashlight bulb would burn brighter if I connected wires to it and plugged them into a 1 20 VAC outlet. Yes indeed, I was correct for about a millisecond before the bulb exploded. I’m not sure if it was the explosion of the bulb or the explosion of my mom (she has “pipes” when she needs them) that fascinated me, but I was forever fascinated.

Thankfully, most of my experiments since that fateful day have had better results and my dear mom smiles more than she fears for her first-born’s life. You’re probably wondering by now where in the world I’m going with this; well, let me tell you.

As I’ve stated many times, I’m a very lucky guy: great job(s), a wonderful life, a wonderful family ... I really have no reason to complain, whatsoever. Part of my great job with Parallax is the myriad BASIC Stamp users I have

Figure /.ADC083I Connections.

P15 O P14 I > P13 O

+5

ADC0831

8

1 V cc I 5

ICS

Vref

CLK

DO

Vin (+)

Vin (-)

GND

4

8

contact with and, on many occasions, whom I get to assist. That is something I truly enjoy doing, but here’s the thing ... in our instant-gratification society, it seems like many BASIC Stamp users especially those who are young and facing the deadline of school projects are too willing to skip the experimentation part of the learning process. My friend and colleague, John Barrowman, calls this “the big bang technique.” They want it all at once: no reading of spec sheets, manuals, or experimenting with parts desired just results, please. Right now!

To be candid, this is a little disappointing. Why? Well, those who “shotgun” their projects miss out on the sheer joy of experimenting and all the learning that comes with those experiments. It took Thomas Edison nearly 1,000 attempts to get a practical, working light bulb and he was a heck of a lot smarter than most of us. Do you think the Wright Brothers looked up at a bird, and then headed for Kitty Hawk with a working version of the airplane? Of course not; there was a lot of incremental experimenting before they made a successful, powered flight.

With my exposure, I get bombarded with questions, some nearly as silly as “Jon, what would happen if I stuck my finger into a light socket?” My standard answer is “I don’t know give it a try.” Okay, okay, I’m being a bit melodramatic (my other job is acting) to illustrate a point and, of course, I would never suggest that someone attempt something that would harm any person or BASIC Stamp module. I guess my point is that for many of those questions the answer would have been derived more quickly and with much deeper under- standing through an experiment versus waiting for an Email from me.

I will quit preaching now ... but please let me beseech you especially those who are young and just getting

Figure 2. ADC083 1 Timing Diagram.

-n r

clk UVUVUVUIA

FEBRUARY 2005

Stamp

started to experiment. It’s fun; it’s a lot of fun. And I promise that you won’t soon forget what you learn from your experiments especially those experiments with unexpected results.

Analog Fun

Okay, let’s experiment. For reasons I can’t explain, a bunch of customers seem to have come up with the ADC0832 (two-channel ADC) and are wondering why the application code for the ADC0831 floating around doesn’t work with it. (That sound you just heard was the old-timers smacking themselves on the forehead and exclaiming, “Duh!”) The reason, of course, is that the ADC0832 is NOT the same as the ADC0831. It’s in the same family, yes, but it is not the same part, so it will require different connections and code.

For our experiments this month, we will need just a few parts: the ADC0831 and ADC0832 (or ADC08832) that we just mentioned, a couple of 10K trim pots, and a project board to connect things to the BASIC Stamp. You can use anything handy: the BOE, the NX- 1000, or my new favorite the Parallax Professional Development Board.

Let’s start with the ADC0831. I will admit that I’ve kind of glossed over the details of this part in the few projects where I used it, because I (incorrectly) assumed that it and code for it had been around for such a long time that everyone who used the BASIC Stamp had an under- standing of how the ADC0831 works and how to apply it. As is occasionally the case ... I was wrong.

Grab your parts and connect the circuit shown in Figure 1 . For the time being, make sure that you have the pot connected to Vref moved to the +5 V position (confirm with a multimeter). Before we get on to the code, let’s have a look at a couple of technical details that the manufacturer provides in the form of a timing diagram. The timing diagram shows the signals in and out of a device and the relationships vis-a-vis time. Figure 2 shows the essential signal timing for the ADC0831.

What this diagram shows us is that we must take the CS (chip select line) low to initiate a read of the ADC0831. Why? Well, maybe we can’t find an ADC0832 and we need two distinct channels. By using separate CS lines to control each device, two ADC0831s can share the Clock (CLK) and Data Out (DO) lines. After the CS line is brought low, the CLK line needs to be pulsed activate the device. After that, eight additional clock pulses cause the data bits to be shifted out of the ADC0831.

At first, we may be inclined to write a subroutine that looks like this:

Read_0831 :

LOW CS

PULSOUT Clk, 50

SHIFTIN Dio, Clk, MSBPOST, [adc\8]

HIGH CS RETURN

It all makes sense, right? We bring the CS line low, blip the clock line with a pulse to wake the ADC0831, shift eight bits in, and then finish up by returning the CS line high. Anything wrong with that? Nope, not a thing. Can the routine be improved? You bet.

Through understanding and experimenting (there’s that dreaded “e” word ...), we find that we can remove the PtlLSOtlT instruction and shorten the code to look like this:

Read_0831 :

LOW CS

SHIFTIN Dio, Clk, MSBPOST, [adc\9]

HIGH CS RETURN

The first question that probably comes to mind is “How can you use nine clock pulses with an eight-bit value?” We can do that by understanding what happens to a value when we use SHIFTIN. Let’s get gory with details, shall we?

When using MSB mode, the target variable is shifted left (MSB goes into la-la-land and a 0 is placed in BitO), then the data line is sampled (in this case, after the clock- FOST mode because the ADC0831 makes data bits available after the clock pulse falls), and that bit is placed into the BitO of our target variable. When we get to that ninth clock, the first bit sampled gets shifted from the MSB (Bit7, in this

FEBRUARY 2005

NUfS&VOLTS

Stamp

Figure 3. ADC083 1 Output.

+5

+5

P15 O P14 O P13 O

AAA r

1 kQ

ADC0832

8

Vcc/Vref

ICS

CLK

CH0

Dl

CHI

DO

GND

4

Figure 4 . ADC08x32 Connections.

we could simulate the SHIFTIN using a loop:

Shif t_In_MSBPOST :

FOR idx = 1 TO 8 adc = adc << 1 PULSOUT CLK, 50 target. BitO = Dio NEXT

case) into the great bit-bucket and is discarded. Here’s how |

For obvious reasons, using SHIFTIN is easier, but understanding the mechanics is helpful when we want to optimize code, or if needed port to a lower-featured controller like the BS1. Now that we can read the ADC0831, it’s a fairly simple matter to display the data:

Main:

DO

GOSUB Read_0831 mVolts = adc */ Raw2mV DEBUG CRSRXY, 10, 2,

DEC 3 adc,

CRSRXY, 10, 3,

DEC mVolts DIG 3, DEC 3 mVolts

LOOP

END

EarthLCD.com We Make s Work.11'

This code uses a constant called Raw2mV that is used to convert the input voltage to millivolts just keep in mind that the value in the program is for +5 on Vref. The value of Raw2mV is $139B, which is the equivalent of 19.6 when using the */ (star-slash) operator. Remember that star-slash multiplies by units of 1/256, so it’s a convenient way to multiply fractional values. How’d we get $139B? First, we take the Vref voltage of 5.00 and divide it by 255, which is the maximum output value from the ADC0831. This gives us 0.019607. If we multiplied directly by 0.019607, we would end up with very small output values, so what we’ll do is multiply by 1,000, which will cause the result of our multiplication to be millivolts (1/1,000 of a volt). Now, we take 19.607 and multiply that by 256 for the star-slash oper- ator. We get 5,019. My habit is to convert to hex $139B as this puts the whole portion of the value in the high-byte

Earth

ezLCD-001 LCD Display Module

Fasv & affordable color LCD intearation

Color 240x160 2.7” TFT ASCII Graphic/Text Commands

Serial+USB+l2C+Parallel Downloadable Fonts

10

FEBRUARY 2005

Stamp

and the fractional portion of the value in the low-byte.

After calculating the millivolts value, the display is handled with DEBUG and a couple of neat tricks using the DIG operator and the DEC modifier (see Figure 3). If you don’t fully understand what’s happening with the output, here’s your big chance: open the help file and read up on DEBUG, DIG (in the operators section), and using formatters (like DEC). Then ... you got it ... experiment. A few minutes spent experimenting will save you hours of frustration later.

Once you have the display figured out, it’s time to play with the Vref voltage and examine its effect on the output data. Using your multimeter, you should be able to prove the following behavior of the ADC0831:

counts = (Vin / Vref) x 255

What you’ll also see is that the output hits a ceiling of 255 when Vin exceeds Vref; we need to keep this in mind with designs when Vin could exceed Vref. One last thing before moving on and, again, you’re on your own after I give you a little push. The ADC0831 is typically used as a single- ended device, but can also be used in differential mode. The Vin discussed above is really the difference between Vin(+) and Vin(-). Let’s say we had an application where we wanted to know how much greater one voltage is than another. We can do it with the ADC0831 by connecting the greater voltage to Vin(+) and the lesser voltage to Vin(-). The output will be the difference between the two values, relative to Vref. What happens if Vin(+) goes lower than Vin(-)? I know because I did an experiment to find out. It’s your turn ...

Two for the Price of One

Okay, let’s give the ADC0832 (or ADC08832) a try, shall we? I think part of the problem some users have had with this chip is that it comes in the same physical format as the ADC0831 (eight-pin DIP). However, the connections aren’t the same and neither is the code (it’s close, though).

Connect the circuit shown in Figure 4. Immediately, you’ll notice a couple of things: the ADC0832 has a DI (Data In) line and there is no Vref pin (Vref is tied internally to Vcc). One of the nice things about using the BASIC Stamp is that it can change an I/O pin’s state on the fly, so we don’t need sepa- rate lines for DI and DO we can tie them together. We don’t want to connect them directly to the BASIC Stamp. Why?

Well, as you’ll see in just a moment, the DI line is expecting three control bits after the CS line falls; then, it activates the DO line and starts pumping out data. If we made a program- ming error that caused SHIFTOCIT to send more bits than required, we could end up with a data collision. Worse, one side could be high while the other is low, causing a direct short and perhaps doing damage to the ADC0832, the BASIC Stamp, or both. A $.05 resistor is cheap insurance; it will protect us from a problem and has no ill effect on communication between the BASIC Stamp and the ADC0832.

Figure 5 shows the ADC0832 interface timing. As with

Learn at home in your spare time.

You can earn more money if you get an FCC License!

Not satisfied with your present income? Add prestige and earning power to your electronics career by getting your FCC Government License.

The Original Home-Study course pre- pares you for the "FCC Commercial Radiotelephone License" at home in your spare time.

This valuable license is your professional "ticket" to thousands of exciting jobs in: Communications, Radio-TV, Microwave, Maritime, Radar, Avionics & more.. .you can even start your own business!

No need to quit your job or go to school. This proven "self-study" course is easy, fast and low cost!

GUARANTEED TO PASS - You get your FCC License or your money will be refunded.

Call for FREE facts now!

(800) 932-4268

www.LkenseTraining.com

COMMAND PRODUCTIONS

FCC LICENSE TRAINING - Dept. 220 P.0. Box 3000 Sausalito, CA 94966 Please rush FREE details immediately!

Name

0r mail <oupon today

Address _ City

State.

Zip.

1 1

FEBRUARY 2005

Nuts & Volts

Stamp

the ADC0831, we start by taking the CS line low. This time, though, the start bit is output (by the Stamp) on the Dio line and must be a 1 . The next two bits configure the ADC0832. The first of those two bits sets single-ended or differential mode. The final bit serves as the channel indicator when in single-ended mode or sets which input is positive when using differential mode.

Let’s code it up:

Read_0832 :

LOW CS

SHIFTOUT Dio, Clk, MSBFIRST, [%l\l, sglDif\l, oddSign\l]

SHIFTIN Dio, Clk, MSBPOST, [adc (oddSign) \8]

HIGH CS RETURN

Once again, the code matches the timing diagram without a lot of mystery. After taking the CS line low, we have to shift out a 1 to get things started. Since we only want to send a single bit, the \1 parameter is used with the value. Next comes the mode bit: 1 indicates single-ended and 0 indicates differential. Finally, we shift out a bit that indicates the channel for single-ended mode or the positive (+) channel for differential mode. When the data is shifted

in, we place it into the selected element of a two-byte array.

The neat thing about the ADC0832 and the circuit we put together is that we can try its various modes without changing any wires. While the demo for this device is a little more involved than with the ADC0831, it’s really no more complicated:

Main:

DO

sglDif = Sgl

FOR oddSign = 0 TO 1 GOSUB Read_0832

mVolts (oddSign) = adc (oddSign) */ Raw2mV DEBUG CRSRXY, 7, (4 + oddSign),

DEC3 adc (oddSign) , TAB,

DEC mVolts (oddSign) DIG 3,

DEC3 mVolts (oddSign)

NEXT

sglDif = Dif

FOR oddSign = 0 TO 1 GOSUB Read_0832

mVolts (oddSign) = adc (oddSign) */ Raw2mV DEBUG CRSRXY, 7, (9 + oddSign),

DEC3 adc (oddSign) , TAB,

DEC mVolts (oddSign) DIG 3,

DEC3 mVolts (oddSign)

NEXT

LOOP

PicoScope 3000 Series PC Oscilloscopes

The PicoScope 3000 series oscilloscopes are the latest offerings from the market leader in PC oscilloscopes combining high bandwidths with large buffer memories. Using the latest advances in electronics, the oscilloscopes connect to the USB port of any modern PC, making full use of the PCs' processing capabilities, large screens and familiar graphical user interfaces.

High performance: lOGS/s sampling rate

& 200MHz bandwidth

1MB buffer memory

High speed USB 2.0 interface

Advanced display Si trigger modes

Compact Si portable

Supplied with PicoScope & PicoLog software

200MH;

Sampling rate (repetitive) 2.5GS/E

Sampling rate (single shot) 50MS/s

2+ Ext triggi

Oscilli

2ns/div to 50s/div

50ppm

Spectrui

0 to 25MH;

USB2.Q (USB1.1 compatible)

Tel: 585 385 1750

www.picotech.com/scope242

Technology Limited

12

Circle #40 on the Reader Service Card.

FEBRUARY 2005

Stamp

r

M

Id

d

i

I

i

Figure 5. ADC0832 Timing Diagram.

The program simply loops through both channels in each of the two operating modes, displaying the raw counts and calculated voltage output as before. Figure 6 shows the results. If you look very closely at that display, you’ll notice that the differential mode differs from the single-ended mode by about two counts this had to do with a noisy test set-up and I could never really get a single-ended reading to hard zero. Finally, Figure 7 shows you the result of an experiment of mine with the ADC0832 set-up. I recently purchased a digital scope/logic analyzer and I hadn’t had a chance to use the logic analyzer portion of it. So, I connected three probes (one each for CS, Clk, and Dio) and captured a part of the transmission that corresponds to the values in Figure 6.

What’s interesting to note is the spacing between the configuration bits versus the data bits. Why do you suppose this is? If you go back and look at the subroutine, you will see this line:

SHIFTOUT Dio, Clk, MSBFIRST, [%l\l, sglDif\l, oddSign\l]

Figure 6. ADC08x32 Output.

projects will come faster. That said, don’t be afraid to try little things, as lots of little things add up to greatness.

Allow me to wish you and your sweetie a Happy Valentine’s Day. (Guys, robots do NOT make cool gifts unless your girlfriend is an engineer or reads Nuts & Volts and SERVO Magazine. Remember, chocolate still works.) And, until next time, Happy Stamping. NV

This is actually quite complicated. We’re asking the BASIC Stamp to send one bit of a constant value, then go retrieve a variable and send one bit from it, then go get another bit and send a single bit from it. This explains the wider timing between the clock pulses going out versus the pulses for the data coming in (which only has to deal with a single variable).

I’m leaving it up to you now go forth and EXPERIMENT! Remember that Rome wasn’t built in a day and nei- ther will all of your projects. What you’ll find is that after you’ve experimented for a while your internal knowledge base will grow to the point where

Jon Williams

jwilliams@parallax.com

Parallax, Inc.

www.parallax.com

Figure 7. ADC08x32 Scope Capture.

FEBRUARY 2005

13

TechKnowledgey 2005

by Jeff Eckert

TechKnowledgey

2005

Events, Advances, and News From the Electronics World

%/%

b

!<*

I

iP

Advanced

Technologies

Another Step Toward Fusion

Computer-generated illustration of the National Compact Stellarator Experiment. Photo courtesy of Princeton Plasma Physics Laboratory.

For decades, we have gazed hope- fully at the prospect of practical nuclear fusion and the promise of cheap, safe, non-polluting energy. The dream has remained elusive, but progress is, in fact, continuing. The next step may consist of the National Compact Stellarator Experiment (NCSX), now under construction at the Princeton Plasma Physics Laboratory (www.pppl.gov).

To produce useful amounts of energy from fusion on Earth, you need to produce a plasma with the required temperature, density, and heat retention. To achieve that, you must determine the best shape for the hot, reacting plasma and the magnetic fields that keep it in place. Advances in magnetic confinement physics and computational capabilities have yielded a new configuration the compact Stellarator, which is somewhat more complicated and

presumably more efficient than existing tokamak devices (primitive fusion generators). The NCSX vacuum vessel, now under construction, is described as resembling a twisted doughnut. It will be made of Inconel 625 and be press formed with 0.375” walls.

According to PPPL, the device’s modular coils are among the most complex, innovative electromagnets ever designed, employing 18 winding forms that consist of non-magnetic stainless steel castings with the wind- ing surfaces machined to a tolerance of plus or minus 0.020”. The largest will be 110” tall and each will weigh approximately three tons. The winding forms will provide the backbone of the modular coil system and will be strong enough to support electromagnetic loads in the range of 7,000 pounds per inch. The $86.3 million project is scheduled to begin operation in 2008.

Microengines Power Small Devices

The microgenerator produces useful amounts of electricity by spinning a small magnet above a mesh of coils fabricated on a chip. Photo courtesy of Georgia Tech.

On a much smaller level but perhaps closer to commercial application is a new microgenerator developed at Georgia Tech (www.ga tech.edu) aimed at providing power to small electronic devices, such as

14

cell phones and laptops. The 10 mm wide microgenerator produces useful amounts of electricity by spinning a small magnet at 100,000 RPM above a mesh of coils fabricated on a chip, producing about 1.1 W of power.

When coupled with a similarly sized, gas-fueled microturbine (or jet) engine, the system called a “microengine” is said to have the potential to deliver more energy and last 10 times longer than a conven- tional battery. In the lab, the Georgia Tech team used an air-powered drill (similar to what your dentist uses to torture you) to simulate the spinning of the magnet by the microturbine (still under development at MIT). Now that initial tests have been successful, they hope to increase the speeds to squeeze out more power.

One of the team’s key problems was figuring out how to spin the magnet fast enough to get useful amounts of power while keeping the magnet from breaking apart; high performance magnets are brittle and can be disinte- grated by centrifugal force at high speeds. To overcome this problem, the researchers optimized the magnet’s dimensions and encased it in a titanium alloy. The goal is to eventually increase the output to as much as 20 to 50 W, allowing it to replace batteries in a range of electronic devices.

Computers and Networking

“Pocketable” PC

In line with the never-ending evolu- tion toward devices that are too small to be used by human fingers, Sony has introduced the VAIO G-Series “pocketable” PCs. The 1 lb device doubles as a media player and

FEBRUARY 2005

TechKnowledgey 2005

includes integrated 802.11b/g wireless LAN capability. You can enter text using a stylus and virtual keyboard on the unit’s tough panel screen or you can plug in the fold-out keyboard (included) if you have room.

Other features include a 5” display, Memory Stick® and Compact Flash media slots, and thumb controls for changing display orientation. It is powered by a Pentium® M processor and Windows® XP Professional OS and you even get a mobile AC adaptor, headphones, and a VGA/Ethernet adapter. The port replicator allows the batteries to be charged and permits the connection of peripherals, such as a mouse, hard drive, or external display. The bad news is that it will set you back about $2,000.00. For more details, visit www.sonystyle.com

New Browser in Town

Late last year, the Mozilla Foundation released its web and Email applications suite, based on the original open source Netscape Communicator product (which was originally named Mozilla). The suite consists of the Firefox 1.0 web browser and the Thunderbird 0.9 Email client. (As of this writing, Thunderbird 1.0 was available, but not officially in final release.) It appears that Firefox is an unprecedented success, with nearly 5 million copies downloaded in the first couple of weeks after its release. According to W3Schools (www.w3schools.com), Firefox had already gobbled up nearly 20 percent of the market by December 2004, second only to Internet Explorer 6, which had 68 percent.

The suite, which has scored highly positive reviews, is available in 26 languages for Windows, Mac OS X, and Linux and can be downloaded from www.mozilla.org/ products/firefox/all.html Other products are available or under development, including Bugzilla (a bug tracking system), Camino (a web browser optimized for Mac OS X with a Cocoa user interface and the Gecko layout engine), and Calendar Project (a cross-platform calendar application).

“World Community Grid” Launched

Would you like to help conduct research to unlock the genetic codes that underlie diseases like AIDS and HIV, Alzheimer’s, and cancer? Improve forecasting of natural dis- asters? Support studies that can protect the world’s food and water supplies? Resolve other dreadful human afflictions? What if it didn’t require any effort, re-education, or significant expense on your part? Well, step right up. You can start now.

IBM (www.ibm.com) along with representatives of many scientific, educational, and philanthropic organizations recently launched World Community Grid (WCG), a global

Sony’s VAIO U-Series PC offers a slim, portable package with lots of accessories. Photo courtesy of Sony Corp.

Anchor

’optical surplus

a division of Edmund Optics

EXPERIMENTAL & COMMERCIAL GRADE LENSES

/ Start Up / Research / Prototype

/ Single Unit Applications / Educational Applications / Initial Run Requirements

Over 5000 seconds, overruns & overstocks ready for delivery at big savings!

ANCHOR OPTICAL SURPLUS

www.AncharOptical. cam

Dept. B051-X916, 101 E. Gloucester Pike, Barrington, NJ 08007

Tel: 1 -856-573-6865 Fax: 1 -856-546-1 965 E-mail:cust_srvc@AnchorOptical.com

Circle #53 on the Reader Service Card.

humanitarian effort created to apply the unused computing power of individual and business computers to help address the world’s most difficult health and societal problems.

To participate, all you have to do is download a small program about the equivalent of a screen saver that links it to the WCG. When idle, your computer will download data on a specific project from WCG’s server, perform computations on the data, send the results back to the server, and ask the server for a new piece of work.

Each computation that your computer performs will provide scientists with information that accelerates the pace of research. You can even track your participation and monitor how many computational contributions you have made.

The software runs only while your PC is operating, so there is no need to keep the machine powered up for extended periods. As of this writing, the WCG had 26,644 members providing time on 35,057 computers and the numbers are growing constantly. If your machine runs Windows XP, 2000, ME, or 98, you can volunteer by downloading the free soft- ware and registering at www.worldcommunitygrid.org

Circuits and Devices

Active Ethernet Simplifies Installation

The power-over-ethernet (PoE) concept, a.k.a. “active Ethernet,” eliminates the need to run 110/220 VAC power to wireless access points and other devices on a hardwired local area network. This increases installation flexibility and can reduce installation costs. All you need to

FEBRUARY 2005

TechKnowledgey 2005

The Hyperlink model PS4820-POE creates active Ethernet links. Photo courtesy of Hyperlink Technologies.

FRONT

BACK

set it up is an “injector” that inserts a DC voltage onto a run of CAT5 cable and a PoE-compatible device at the other end. Alternatively, you can attach a “picker” or “tap” to a non-PoE-compatible device and achieve the same effect. The concept is complicated somewhat by the need to determine whether you need a passive or regulated tap, but it’s not brain surgery.

Hyperlink’s model PS4820-PoE provides this capability, allowing you to connect to wireless LAN access points and bridges, WiFi amplifiers and amplified antennas, voice over Internet Protocol telephones, web cameras, Bluetooth® access points, and other devices. The PoE injector and 48 VDC, 20 W power supply are provided in one unit and it operates from a 100-200 VAC input. It is compatible with most wireless LAN standards, including 802.11a, 802.11b, 802.1 lg, and Bluetooth, as well as GSM, ISM, UNII, WiFi, PCS, and RFID applications. Single units are priced at $39.95, with quantity dis- counts available. Details are available at www.hyperlinktech.com

Better Bass From Tubular Speakers

M

b

£

f*

|H

13

Whether your goal is to enjoy more accurate sound reproduc- tion from your home stereo system or pound your brain into a tapioca consistency while driving around in your chopped, channeled, louvered, and lowered Kia, it would be nice to avoid sacrificing inordinate amounts of space to huge subwoofers. The linear array transducer (LAT)

TheTymphany linear array transducer provides more bass in less space. Photo courtesy ofTymphany Corporation.

technology from Tymphany Corp. (www.tymphany.com), is designed to achieve that. According to the company, the device, “infuses the low frequency response of a subwoofer into a full range woofer with a highly efficient and novel tubular form factor. The Tymphany LAT makes it possible to achieve lower frequencies from today’s space-sensitive products and to develop more highly integrated consumer and professional audio products in the future.”

In a departure from conventional cone loudspeakers that displace air across a single diaphragm, the LAT technology displaces air using a linear array of multiple smaller diaphragms to generate sound at high decibel levels across a range of frequencies from 20 Hz to above 4 kHz. Sound radiates through multiple flow ports along the side of the housing, producing deep bass using one-third of the space of a traditional cone transducer. The tech- nology employs a balanced drive design that consists of a series of coupled diaphragms that are driven by opposing end motors. One motor drives half of the diaphragms while the other motor drives the other half in opposition. The use of opposing end motors is designed to cancel out structural vibration, so the transducer will not shake or transmit structure- born vibrations to critical circuitry.

The technology is scalable from 2” to 12” in diameter at virtually any length. As of this writing, no informa-

tion was offered as to commercially available equipment, but the patented design is expected to appear in audio products soon.

Industry and the Profession

PC Company Deaths Predicted

According to the research and analysis company Gartner, Inc. (www.gartner.com), three of the top 10 PC manufacturers will bite the dust by 2007. The company forecasts that annual revenue growth for PC makers will average only two percent from 2006 through 2008, which will force the marginal compa- nies out of the market.

At present, the top 10 consists of (in order of units shipped) Dell, HP, IBM, Fujitsu Siemens, Toshiba, Acer, NEC, Legend, Gateway, and Apple Computer. Shortly after Gartner’s announcement, several news articles revealed that IBM put its PC business up for sale, with a Chinese company as a likely prospective buyer. However, it is expected that the company will continue to sell IBM-branded products, even if they are built by someone else.

Which companies will disappear? Time will tell.

Free Tutorial Previews Available

The IEEE Communications

Society is offering free five minute previews of its enhanced conference tutorials online. Topics available for preview include security and information assurance, smart antennas for wireless systems, an introduction to universal plug and play (CJPnP), and broadband wireless IP.

Originally presented at recent IEEE Communications Society spon- sored conferences, the tutorials run 2.5 to 5 hours in length and contain the original visuals and audio. They are available for purchase for $200.00 for society members and $250.00 for non- members. For more information, visit the society at www.comsoc.org NV

FEBRUARY 2005

Need Device Connectivity To The Pervasive Internet?*!

Save Money, Save Time , Use The PowerCore

"Based on experience, I can tell you that Rabbit stuff works before you can get it all out of the box."

-Fred Eady, Circuit Cellar

The Core of your Embedded System

The PowerCore FLEX is a complete Rabbit microprocessor system with optional features such as a power supply, Ethernet, and a low- cost rugged A/D system. It plugs into a motherboard you design. You pay only for the options you need, and we quickly manufacture it. Development Kits include a powerful software development platform and extensive libraries.

Network and Internet Support

Your embedded device can network and serve web pages. Hardware and software supports Ethernet, Wi-Fi, and cellular telephone data networks.TCP/IP and most associated protocols are included in the Development Kit. SSL secure server software and other premium software modules are available at a nominal cost. With the implementation of optional software modules such as RabbitWeb, SSL,PPP,and AES, you can securely and conveniently communicate with your embedded device from anywhere in the world.

Development Kit Includes

A loaded PowerCore FLEX with all options or non-Ethernet low-end version

Prototyping board with development area.

Documentation on CD.

Dynamic C integrated development environment.

Serial cable, power supply, and more.

Buy A Development Kit!

Purchase a complete development kit, PowerCore, and prototyping board with sample circuits.

www.rabbitFLEX.com

Time 0^

$9Q Pay Only For qtfsSoo What You Need

Configurable Features

Microprocessor Speed

On-Board Power Supply

SRAM /Flash

Serial Data Flash

Ethernet Option

A/D Converter System

Battery-Backed SRAM

Standard Features

39 General Purpose I/O

5 Serial Ports

Real-Time Clock

Watchdog /Supervisor

Pervasive Internet: Embedded devices providing internet connectivity for commercial and industrial applications. Learn more at www.rabbitf1ex.com

Semiconductor

2932 Spafford Street, Davis, CA 9561 6

Tel 530.757.8400

FEBRUARY 2005

Circle #52 on the Reader Service Card.

Personal Robotics

by Mike Keesling

Understanding, Designing, and Constructing Robots and Robotic Systems

Personal Robotics

Basic Language Comparisons

As we approach middle age, we often try to re-assert our youth. For some, this mani- fests itself as an overwhelming need to buy a red Corvette, sunglasses, and possibly trade in the old wife for one with that “new wife smell.” For geeks like me, we remember the old days when a computer was powerful if it had a video screen, mass storage was something you did with an audio cassette, and Basic was this remark- able language that allowed you to make your computer do amazing feats of magic by drawing different ASCII characters on your screen.

You may remember back to your first Basic program. It probably read something like this:

FOR A=100 TO 0 STEF-1 PRINT A;

PRINT bottles of beer on the wall” NEXT A

b

£

lo8

8

IfO

It was interpreted Basic and it ran painfully slow if you did anything iterative, but back then you saw yourself as an unstoppable god with this new power. I recently found myself looking for that power and simplicity in a PC-based language. My goal here is to eventually simu- late and then finally interface to robots with a relatively easy-to-use and inexpensive language. I could then share my source code with you and not break your bank accounts. I decided on looking into five different Basic implementations each with its own strengths and weaknesses: Xbasic Free

RealBasic $ 1 49.00+

BlitzBasic $100.00

DarkBasic $49.00

PowerBasic $199.00+

18

I intentionally omitted Visual Basic.net out of pure prejudice against Microsoft’s monopoly on the computer market, though I am sure I will regret it.

Now, I know there are other Basic implementations out there, but I decided to limit the scope of my investigations to the ones that seemed to have the highest promise to do all the things that I needed them to do. My needs seem modest enough; I just want to incorporate mathematics, graphics, communications, and ease-of-use into my projects.

Mathematics is important to me because I rely on trig functions a lot. I like to simulate my mathematics in Excel, for instance, but when you start building spreadsheets that make your workmates worry for your sanity you have to examine what and how you do your simulations.

Having been an art major in college, I am a very visual person. I really consider graphics as the force that got me into computers to begin with. I use graphics to represent complex mathematical concepts and mechanical interactions; I make it a point to really thrash away at my spreadsheets to make them draw pretty diagrams via graphs and charts.

The communications are impor- tant to me because, one day, I hope to transfer the data my software generates into data living within an actual hardware representation of the thing I am simulating. I hope to do genetic algorithms and artificial neural networks, but these are often too time-consuming to let take place in real time.

Ease-of-use ... what can I say, I remember when Basic was just that. After all, for those of you not in the know, Basic stands for Beginners’ All purpose, Symbolic Instruction Code. You would think it would be easy, but now I can assure you that this is not always the case.

To me, the one thing that truly isolates me from true simplicity is the IDE (Integrated Development Enterprise) itself. It used to be a convenient means to do some simple things with a compiler, a level of isolation from the nitty-gritty of the software’s core. Now it seems to me that, in some instances, it has gone too far.

BlitzBasic3D

BlitzBasic3D or B3D is, in essence, a Basic wrapper on the really powerful DirectX 3-D wrapper for the really, really powerful commands internal to your graphics card. On top of this are a lot of sound, sprite, file, network, and math commands.

Most of everything I could ever want in graphics is here: two- and three-dimensional graphics com- mands, trig, entity collision, and textures. The one lacking piece was the ability to use the COM ports easily. There are third party exten- sions available (called DLLs for Dynamically Linked Libraries), but I was not able to get them to function on my machine. I did get the parallel port communications working, however.

As discouraging as the lack of COM ports is, getting graphics out of this is frightfully easy. The IDE does not obfuscate or isolate; it is simply a useful tool. I did, however, make the

FEBRUARY 2005

Personal Robotics

unfortunate mistake of buying it from a site other than BlitzBasic.com and, as a result, waited many moons for my registration number. I pur- chased from BlitzCoder.com and, eventually, they locked my thread on their forum complaining about the poor response time I was getting from them. Remember, BlitzBasic or Blitz Research is good; BlitzCoder is bad.

I really want the COM port to work and intend to stay tuned to see what comes of it. Overall, it’s really cool and fun; I will try to get the data I need through the TCP/IP functionality before I give up.

DarkBasic

DarkBasic is everything B3D is, but a little more more graphics functions, faster, cooler, slicker. It’s a little more complicated than B3D, but the power is worth it. The pro version comes with a lot of neat stuff, like 3-D models. What was fun here is how easy it is to get stuff that looked so cool up and running so quickly. I built an MP3 player in two hours, for example.

Again, I failed at my mission objective. I have not succeeded at getting DBP to access the COM ports via a DLL. I only mention B3D and DBP because I have to believe that, one day, they will make COM ports standard or one day some individual will be able to make the external DLL that allows the COM ports to operate and all my troubles will be solved. I have a friend who is supposed to help me out on this one, possibly just writing the DLL I need from scratch.

Xbasic

Okay, down to the point. There’s no direct method for COM port access, except through the Windows API (Application Program Interface). Avoiding the API is the whole reason I was going down this road to begin with. Top it off with a lot of libraries for everything and it starts getting complex.

It appears to be very powerful

and fast; I imagine that, with enough dedication, I could get it to do what I want, but I am really diverting from my course at this point. I am starting to grit my teeth at night over this and that is just not healthy. The COM port thing has got me bugged.

I downloaded Xbasic from www.maxreason.com/software/ xbasic/xbasic.html It is worth a free

download and people out there have succeeded in getting the COM ports to work.

RealBasic

RealBasic is a fun one. I did man- age to get the COM port talking to a microcontroller very quickly, but the whole methodology is alien to me.

FEBRUARY 2005

Personal Robotics

Schematic and PCB Layout

Powerful and flexible schematic capture.

Auto-component placement.

Rip/entry PCB routing.

Polygonal gridless ground planes.

Library of over 8000 schematic and 1 000 PCB foot prints.

Bill of materials, DRC reports and more.

Mixed Mode SPICE Circuit Simulation

Berkeley SPICE3F5 simulator with custom extensions for true mixed mode and interactive simulation.

Six virtual instruments and 14 graph based analysis types.

6,000 models including TTL, CMOS and PLD digital parts.

Fully compatible with manufacturers' SPICE models.

Proteus VSM - Co-simulation & debugging for popular Micro-Controllers

Supports PIC16 & PIC12, AVR,8051, HC11 and ARM micro-controllers.

Co-simulate target firmware with your hardware design.

Includes interactive peripheral models for LED and LCD displays, switches, keypads, virtual terminal and much, much more.

Provides source level debugging for popular compilers and assemblers from HiTech PICC, Crownhill, IAR, Keil and others.

Microchip PICT 8

Supported models of the PIC 18 includes PIC18F242, PIC18F252, PIC18F442, PIC18F452, PIC18F248, PIC18F258, PIC18F448 and PIC18F458.

Basic Stamp BS 1 and BS2

Proteus VSM for BASIC Stamp contains everything you need to develop and simulate designs based around the BASIC Stamp.

See examples in downloadable Demo at www.labcenter-electronics.com

"/ finished my first design, schematic and PCB in one day."

"What a great tool! I love it. " DAN GILL

"For the cost of the software compared to the productivity gains, I consider Proteus to be pivotal in the commercial viability of my company and by far represents the best value for money of anything Tempus possesses." ROB YOUNGS, Tempus Consulting

"PROTEUS stands out as the best all-round program in this review. Other programs reviewed have strengths in the pcb design process, Proteus maintains a constant high level of capability throughout. Whether a schematic, user-friendly interactive routing, configurable autoplacing, competent autorouteing, or a combination of the above, PROTEUS handles everything very well." Electronic & Wireless World CAD Review Roundup

Save Time. Save Money.

Proteus Starter Kit -$199 Full System - $1899 "This is clearly superior in every respect."

JMsystems inc |abcenLeo

Electronics

WWW.labcenter-electroniCS.com Tel: 905*898»0665 info@r4systems.com

RealBasic is an event-driven Basic: sit around, wait for something to happen, and respond. I still haven’t got- ten used to that way of doing things. The development environment is a bunch of objects like buttons, windows, or deeper level items that you drag to your main window. You rename them intelligently and stick in bits of code that are associated with the actions you care about. It’s truly the epitome of OO (Object Oriented) programming and I loathe it.

RealBasic does everything I need it to, is inexpen- sive, and has the math support I need. An added bonus is that you can compile for the Mac, as well. I really have to apply myself to this one because it does everything I need, but I am a stodgy old man resistant to change, set in my ways, and more apt to be hosing down kids who wander onto my property looking for lost baseballs than changing the fundamental way I code.

PowerBasic

PowerBasic promises access to the COM ports with- out any calls to the Windows API, which is something that only RealBasic has been able to do. Unfortunately, PowerBasic doesn’t directly support graphics, but it does allow you to access the API without having to use a DLL. In addition, there is also an external, third party graphics API wrapper available.

Now, while this seems like just another trade-off, there is an advantage to buying the graphics support; you get the quality of someone’s efforts to produce a final product, not someone else’s hobby in the form of a DLL. Simply put, being able to use the API strips off a layer of complexity because you do not have to rely on external DLLs. In addition, because you access the API directly, you can wrap your own DLLs, too. This is a nice way to compliment other languages that can make use of them.

Another nice feature of PowerBasic is that it is really, really fast. For genetic simulations and neural networks, you can’t beat speed. I haven’t done a direct comparison, but it is really lightning fast.

Overall, I think I am quite pleased with PowerBasic. While it is not the complete solution like RealBasic it is more intuitive for me. I was afraid I would have to really apply myself to RealBasic, but it is looking very promising that I will be able to tackle my programming needs without breaking the bank.

Overall, I think PowerBasic will probably be the one for me. I will have to figure out how to use the graphics to do what I want, but it is the closest thing to a complete solution that I have found. While it is more expensive than all the others, it is closer to the “core” of the machine in the areas that I need. For just pretty pictures, I will probably use BlitzBasic, but for the serious stuff PowerBasic is the winner. NV

FEBRUARY 2005

Circle #57 on the Reader Service Card.

W inds^r

See more surplus electronic goodies at:

www. shopatwindsor. com

CCFL Florescent Light Inverter

New power inverter drives 2 lamps up to 5W each! Simple to use, 12 VDC in, con nect florescent lamps to output. Module gen erates correct starting and operating voltage, lamp current and is even dimmable!

01 28520R $9.95

Fiber Optic Transceiver

New, by Infineon. Has laser transmitter and receiver in one package! 1.25 Gb/s data rate up to 700 M on low cost multimode fiber!

Super small size, complete specs on the web. Make your own fiber optic link!

01 25461 R (Set of two) $1 9.95

Hitachi LCD display

16 character by 2 lines 5x8 dot matrix character 64.5 x 13.8 mm viewing area STN neutral mode reflective LCD recently discontinued by Hitachi but a very common and most used part. Directly crosses over to the Optrex DMC16249, brand new stock!

01 23260R $4.95

module (size 1x1x1 .5”!) includes red laser, beam splitting mirror, opamps, photo sensor, transistors, processor, ICs, etc. From handheld laser barcode reader. We sold out of the last style we had! No specs, but buyers figured out the hook up for the last group, we’ll post on the web any new info on this one, should be easy, has just 12 pins on the connector.

0131346R $14.95

C size Nicad Battery

This is the real deal, a true 2 A Hr Nicad, Button top works in any device too! Brand new by Sanyo.

0130380R $2.00

Powerful DC Motor

Made by Johnson Electric 1 2 VDC @0.85 A no load, 1 7,000 rpm, 3 vdc @ .51 amps 4,200 rpm, 6 vdc @ .6 amps 8,500 rpm. Similar to Johnson Electric HC313MG series but higher power. Actually runs as low as 1 volt oper ation! (1200 rpm .46 amps). Size: 2" I x 1 .5" dia 7/8" long eccentric brass shaft end easily broken off to form a .5" long x .312 dia round shaft end.

01 23850R $4.95

Windsor

Laser Scanner Bar Code Module

mJlfl

Wow! What a a cool item! 1 Brand new laser scanner

WINDSOR DISTRIBUTORS COMPANY 19 Freeman Street Newark , New Jersey 07105 3708 Ph: 973 344 5700 Fax: 973 344 3282

DISCOVER

ORDERING INFO: Shipping and insurance charges made after order is packed. You will be notified by Email. Orders under $25 add $5.00 small order fee. Credit cards will only be authorized on US and Canadian banks. Please contact Windsor regarding payment instructions for other countries.

LED BLOWOUT!!!

Here’s a deal that just will not last long Wind sor’s LED Blowout! Super high quality, factory prime bright LEDs. Ideal for all those projects that you’ve wnated to build, but just didn’t have the quantity of LEDs needed. You will not find pricing like this ever again we bought out two factory inventories! Here’s the scoop: Big bag o leds have 500 pcs and are all RED jumbo 5 mm size with crystal clear bulbs. You pick the lumi nous intensity, bear in mind that the 2500 mcd high bright units are flashlight intense! Big buy ers will love the 2,000 LED boxes! These LEDs are the smaller T 1 size with full leads, available in Red or Green. Imagine 2,000 Leds for less than a penny each!

01 31 288R High Bright 500pc bag $15.00 01 31 292R Standard Bright 500 pc bag $15.00 0130956R Box o leds Red 2,000pcs $19.95

0130955R Box o leds Green 2,000pcs $19.95

Windsor’s Blue LED Special

Holy Smokes! Can you believe the price on this BLUE LEDs? First quality from our factory buyout. Big and bright! These normally sell for $1.50 each and that’s in big quanti ties! We’re crazy to sell 'em so cheap!! 0131297R 50pcs $19.95

0131297 500pcs $99.95

Laser Fiber Optic Transmitter

Brand new HP Agilent model LST2829 Laser transmitter mod ule. Capable of 622 MB/s data rates, 1 mW output power, 1 300 nm wavelength, includes on chip )ower monitor diode. These are ligh end quality lasers and not often found on the surplus mar ket! Two style available, A: 32” long thin pigtail fiber and B: 16” long encased fiber. Each has the same electrical specs. Price: $9.95 each Item A: 0128526R Item B: 0128536R

Cellphone CMOS Camera Module

Wow! Here’s the guts of the camera in all the new cellphones. Brand new assemblies made by Pic tos, model 0187837M11. Camera head has neat rotating head and snazzy look. Flexible circuit board has tiny connector on end for hook up. Opening the cam era head reveals a super tiny sin gle chip camera 1C that is only 3/8” square including built in lens! Sorry we have no specs on this unit, but should be easy to research on the net or with a scope.

0128842R $8.95

Tool Set

Well made quality 3 piece plier set.

Includes deluxe padded zipper

case. Pliers are big 8” in size, you get: needlenose, diagonal and lineman style with handy crimper and stripper dies on each tool! Get a few for the car, gifts and toolbox, they are that nice!

01 28871 R $12.95

Check our web site for more great deals!

Truck Stereo

New in dash cassette stereo AM/FM radio, LCD display, drives 4 speakers (80 watts!) Even has Weather band! Quality fully enclosed case, easy hookup, great for in wall home installations! Runs on 12 VDC.

01 28872R $29.95

Ion Generator

Build your own Ion Breeze air purifier! New module, 120 VAC in, 7.5KV out! Surplus from air cleaner maker who sold them for $200!

01 28873R $7.95

Cellular Bi Directional Amp

Super rugged unit features powerful 3 watt RF amplifier for transmit and sensitive receive amplifier. Utilizes diplexer ceramic fil ters. Additional circuitry for protection, regu lation, etc. Sorry, we have no specs on this, but its a treasure trove for the experimenter and RF guru. Brand new. Size: 4.5 x 5 x 1 .5” in rugged extruded aluminum heat sink style case. Uses mini UHF connectors.

0127460R $14.95

Rechargeable Battery Blowout!

Popular Nicad batteries, 1 .25V all brand new, recent stock. A &B are NiCad and C is NimH. A: AAA 400mah 0125339R 2 for $1.00

B: Sub C 2500 mah 0125443R 2 for $1.75

C: 3.6 Volts 750mah 01 25348R 2 for $3.00

Nice, new 5 AA cell nicad pack. 6 Volt 700mah with 6” wire leads. Great for projects or cordless phone replacements. 0125345R $2.50

Big box of 50 brand new AA button top NiCads. Fit anywhere an AA battery does. 1 .25V 800mah. Best price in the USA! 0128870R $19.95

Lithium Ion Rechargeables !!

Rechargeable Lithium batteries pack the highest density of power for size and weight! Ideal rec tangular size is easy to fit in your project. All 3.6 Volt and approx rated Amp Hour capacity.

A: 1 Ah 1 .95x1 ,34x.4” 01 25337R $1 .50

B: ,8Ah 1.95x.1.34x.25” 0125349R $1.25

C: ,8Ah 1 .95x1 ,24x.23” 01 25350R $1 .25

www.shopatwindsor. com

21

FEBRUARY 2005

Circle #55 on the Reader Service Card.

Electro- Islet Go to www.nutsvo/ts.cofn click Electro-Net

umuiiiiituiiiii

SERIAL LCD DISPLAYS

packed with features

I * total control / easy to use

very low power See the SMARD4™at

www.cruxanalysis.com

Earth ,

COM

See the World's Largest Collection of LCDs and LCD Products

siperbrighdelsxim

LEDs LED Bulbs LED Products

m

* Free software and updates Windows 9x/2000/Nt/XP

* Quality PCB and Silkscreen for easy assembly

See all of our Educational Electronic Kits visit us at www.ElectronicKits.com

Save up to 00% on electronic components and microcontrollers

www.futurlec.com

\/ z /\ n

audio

www.audioxpress.com

For the do-it-yourself audio enthusiast...

Helpful articles Hands-on projects I 12 issues just $29.95

Expert advice New technologies I -save $54!

Call 1-888-924-9465 to subscribe today!

IQP Add USB to your next project— UuD it’s easier than you might think!

USB-FIFO USB-UART USB/Microcontroller boards

Absolutely NO driver software development required!

www.dlpdesign.com Design services available

MMM;uetinedia.a)m

Geiger Counters: ■■ Digital, PC & Analog

As sold to NASA and US Government

IMAGES SI INC.

$

CO

b

£

fog

s

|h

www.imagesco.com/geiger

electronicsurplus.eom

PICmicro MCU Development Tools

BASIC Compilers Device Programmers Prototyping Boards Experimenter Boards Books

ONE PASSircuit™ “The Future > ^ ' of Proto- ** typing”

www.onepasmc.com

Go to www.nutsvolts.com click Electro-Net

Remember when ...

...electronics stores were stocked to the rafters with every component imaginable and there was ALWAYS

a knowledgeable person there to help you?

@ HOME

JAMECO

Think those days are gone?

Well they're not! -800-455-61 1 9

You just need a little Jameco@Home.

Call for a FREE catalog today.

We have the electronic components and knowledgeable Technical Support people who can help bring back the fun in your electronics hobbies, inventions, and DIY projects.

Be sure to visit our new website at

www.Jameco.com/nvb

Jameco@Home

where electronics is still fun!

Circle #42 on the Reader Service Card.

Q&A

with TJ Byers

Electronics Q&A

In this column, I answer questions about all aspects of electronics, including computer hardware, software, circuits, electronic theory, troubleshooting, and anything else of interest to the hobbyist.

Feel free to participate with your questions, as well as comments and suggestions.

You can reach me at:

TJBYERS@aol.com

What's Up:

(O

b

£

f*

|H

13

Confused about coils? Let me set you straight. It’s too cold to be hot two thermostat controllers.

Ozone alert. The grid dip revisited and a power supply upgrade. Don’t miss NASA’s new cool website.

24

Wind Your Own

Q.I heard that there is a formula that can help you wind coils by putting the values of diameter, length of coil, and numbers of turn into an equation. What is that formula? Will different sizes of the wire affect the coil? Please give me an example, if you can.

V. Stark via Internet

Of all the disciplines associated ith electronics, inductance is undoubtedly the least understood. Unlike Ohm’s Law which contains just two variables inductance is a mixture of physical sizes, shapes, and voodoo magic. To answer your ques- tion, all we have to do is look at the equation for calculating inductance, shown in Figure 1. As you can plainly see, inductance increases as the diameter increases strange, but true.

Now let’s wind a 250 pH coil on a 1 x 2” form. The formula for that is

V W-I(9R + 10L)

N = V 250(9 x 0.5 + 10x2)/ 0.5 N = 157 turns

The same 250 pH coil on a 2” x 2” form is:

N = V 250(9 x 1 + 10 x 2) / 1

N = 85 turns

Now, let’s deal with the second part of your question wire size. The diameter of the wire determines how many turns you can wind on a coil form per inch. It also determines the resistance of the coil and the maxi- mum amount of current you can run through the wire before it burns up.

Let’s take the turns per inch first (refer to Table 1). From the chart, the largest wire you can use for the 1 inch coil form is 29 gauge or 24 gauge for the 2 inch form. Of course, you can use smaller wire. If you do, though, you’ll need to spread the turns apart so they occupy the full 2 inch length.

The resistance of the coil which is proportional to the length of the wire is calculated by multiplying the circumference of the form by the num- ber of turns. In the case of the 1 inch form, the circumference is about 3.1 inches for a total length of 493 inches or 41 feet for a resistance of 3.4 ohms (8.183 x .41 = 3.35). The 2 inch form has a resistance of 1.14 ohms (you do the math). The maximum current is 1.2 and 3.5 amps, respectively.

More Wind Your Own

a I recently ran across a roject that called for a multi-layer RF choke. It would seem to me that placing layers in parallel, one atop the other, would decrease the inductance, not increase it. I’m referring to the parallel inductor formula shown here. Can you clarify this for me?

Figure I

Single Layer

Radius (R)

Number

Length (L) of Turns - (N)

Multi-Layer

Coil Average Width Radius (C) (A)

Length (B)

uH = -

uH = -

6A + 9B + IOC

FEBRUARY 2005

Q&A

LI x L2

Ltotal =

LI + L2

C. P. Davis via Internet

A You’re confusing series induc- ors with parallel inductors. When you wind more than one coil with a single strand of wire either side by side or one atop the other it’s a series inductor. If the inductors are magnetically shielded from each other, the total inductance is:

Ltotal = LI + L2 + L3 ...

However, it’s virtually impossible to prevent coupling between magnetic fields. When you purposely wind one coil on top of another, the mutual coupling becomes even greater. The total coupled inductance of a multi- layer coil can be determined by the formula below, where M is the mutual coupling factor between the coils.

1

Ltotal = ~

+ 1

Ll + M L2 + M

= LI + L2 + M(L1 + L2)

There are several formulas for cal- culating the number of turns required in any given application and the results often differ a lot from one formula to another. I use the Wheelers formula for multi-layer coils. Find it in Figure 1 .

The formula assumes an air coil. A ferrite core will reduce the number of turns by 10% to 25% depending upon the bulk and permeability of the ferrite material. A long ferrite rod can reduce the number of turns by as much as 50% to 60%. A brass tuning slug will increase the number of turns by 5% to 10%.

Cooling Fan Controller

Q* I would like to make a control circuit that would turn on a cooling

FEBRUARY 2005

Wire

Gauge

Turns per Inch

Resistance per 100’

Current in mA

22

37

1.614

7,000

23

41

2.036

4,700

24

46

2.567

3,500

25

52

3.237

2,700

26

58

4.081

2,200

27

65

5.147

1,700

28

73

6.490

1,400

29

82

8.183

1,200

30

90

10.32

860

31

101

13.01

700

32

113

16.41

530

33

127

20.69

430

34

143

26.09

330

35

158

32.90

270

36

175

41.48

210

Table /.

Enameled copper wire sp

ecifications.

fan whenever my air compressor starts up. After the compressor shuts down, I would like the cooling fan to continue running for a time to completely cool down the compressor.

I was thinking of controlling the fan using temperature monitor- ing. I could mount a temperature sensor onto the compressor. When the sensor went above a preset temperature (say, 100°F), the cooling fan would start. When the compressor temperature dropped below this setting, the cooling fan would turn off. It would be nice to have the turn on and turn off temperatures adjustable. What do you think?

Bill Blackburn via Internet

A I think it’s an excellent solu- ion because it takes into account ambient temperature which can make the cooling more or less efficient. I suggest the ven- erable LM56 (or DS56) thermostat IC. It’s small so you can easily attach it to the compressor requires few external parts, and is resistor programmable.

Inside the LM56 are two thermostat switches digital outputs that switch between high and low according to a set temperature point. For this application, we only need one of those switches. The circuit requires just six external components including the relay (Figure 2).

The relay coil is rated 5 volts at 20 mA such as the RadioShack 275-232.

The contacts are rated 1 25 VAC at 1 A, so use them to switch the fan’s relay rather than the fan motor which will likely melt the contacts unless it’s a small fan.

Resistors R1 and R2 set the temperature point. The set points for this circuit are 1 1 1 °F (44°C) on and

102°F (39 °C) off. The following equa- tions calculate the R1 and R2 values for other temperatures:

VT1 = (6.2 mV x temperature) + 395 mV

R1 = (VT1/1.25) x 25K R2 = 25K - R1

Make sure you convert the milli- volts into volts when calculating R1 and R2. The difference hysteresis

25

Q&A

between temp on and temp off is internally set at F (5°C).

I’m Thirsty, Water

Me

QCold weather has forced me to move my potted plants indoors. Now, I’d like to build a plant-watering monitor so that I know when a plant is thirsty and when it’s feeling fine. I saw a Plant Watering Monitor kit in a UK catalog, but the value difference between the Sterling pound and US dollar, along with the shipping, is enough to discourage me from

buying it. (The total is about $55.00.)

Basically, it has an LED for “Water OK,” one for “Needs Water,” and one for when the batteries (four AA cells) are low. It advertises a long battery life by flashing the LEDs rather then have them run steady-state. Do you have an equivalent design that I can make with readily available parts? No microcon- trollers, please.

L.A. S. via Internet

What you ask for can be done sing a single LM339 comparator chip (Figure 3) that sells for less than

$.50. The first of the four compara- tors senses the moisture of the soil by measuring its conductivity (resistance). The “Sensitivity” control lets you set the trip point for a wide range of soil types and moisture conditions.

When the plant is happy, the output of the comparator is high which, in turn, lights the “Happy” LED. As the resistance of the soil increases loses mois- ture — the comparator output flips to the low state and lights the “Thirsty” LED. The “Low Battery” comparator is biased so that, when the battery voltage drops below 4.0 volts, the LED lights.

To extend battery life, I’ve powered the comparator chip and LEDs with a voltage that’s off for about 4 seconds and on for 1/3 of a second using a CMOS LMC555 astable multivibrator. That is, every four seconds, a voltage is applied to the LM339 and LEDs for 1 /3 of a second a flash resulting in a duty cycle of 8 percent. The average current draw is typically 400 pA which means your AA cells will easily last through the winter. Increasing the 47 pF cap to 100 pF will nearly double the battery life.

Surplus NiMH Batteries

Q* I bought some bargain AA sized nickel-metal-hydride

(NiMH) batteries that I found on sale at a surplus outlet. I’m wondering if they can be recharged in a unit I have that is made to recharge nickel- cadmium (NiCd) batteries. Or do they have some fancy controller charge requirements?

Dale Blackwell via Internet

I bought a bunch of them yself from All Electronics Corp. (888-826-5432; www.all electronics.com). Battery capacity is rated in mAH (milliampere-hours). The capacity of the NiMH AA cells on the surplus market is between 1,100

</»

£

I08

8

IfO

26

FEBRUARY 2005

Q&A

and 2,200 mAH. The 1,800 mAH cells I have state right on the case of the battery that they should be charged with 450 mA for 5 hours or 180 mA for 1 4 hours after which they have to be disconnected from the charger.

However, these currents and times assume the cell is fully discharged. If it’s only half-used, then these times will overcharge the battery. Once a battery is fully charged, it produces gas creating a high internal pressure and a sudden rise in temperature. At this point, the battery will begin to vent and release its electrolyte which severely shortens the life of the cell.

As a rule, a NiCd battery charger can be used to charge a NiMH battery provided the charger has a two-step charging routine. This class of charg- ers first applies a fast charge of C/4 to 4C (the total capacity of a battery is defined as C), then switches off (or applies a timed trickle charge).

There are two recommended methods of detecting charge termina- tion: using a temperature sensor in the battery pack or using negative AV. The temperature technique relies on detecting the sudden rise in battery temperature to shut off the charge. The negative AV system relies on the fact that the NiCd/NiMH battery voltage peaks and drops about 20 mV per cell when fully charged.

Quality chargers use a mix of both methods, called AV/AT. Cheap battery chargers can’t afford this much circuitry and simply place the battery on prolonged trickle charge (typically C/10) in the hope that it doesn’t do much damage.

This Old House Thermostat

QMy house has an open stairwell between the main floor and the basement, where I have an office and my electronics workshop. When the weather is neither too hot nor too cold, the circulating fan on the heat pump stays off for long periods. The cold air gravitates down and the hot air goes up, creating an uncomfort- able condition in both places.

Eventually, the thermostat detects this and the fan starts. To correct the problem, I built 555 timer to cycle the fan. This helped a lot, but ran the fan at the wrong time in the summer.

I then built a differential tempera- ture device using two thermistors, an op-amp, and a relay. Unfortunately, my design was not sensitive enough the temperature spread was too great. I kept changing feedback resis- tors, but was unable to get it right. I would like to build a controller that I can comfortably adjust to a 1 to F differential.

C. P. Furney, Jr.

Loudon, TN

A Maybe your problem is that ther- mistors are non-linear. That is, the resistance doesn’t stay in step with the temperature. Let’s replace the thermistors with the venerable LM34 temperature sensor (shop around for best price; it can vary widely). The LM34 is a precision Fahrenheit temperature sensor with a guaranteed 10 mV/°F linear output (80 mV at 80°F, 100 mV at 100°F).

Now, if you place two LM34 sensors on the differential inputs of an op-amp (any garden variety will work), you automatically get a

voltage that reflects the difference in temperature between the upstairs and downstairs (Figure 4).

This voltage is first multiplied by 10 and then fed to a comparator with an adjustable temperature differential (SET) up to 10°F. This should give you enough range between upstairs and downstairs so that the rooms don’t become uncomfortable.

The 1M resistor provides a slight amount of hysteresis to prevent the fan from hunting constantly going on and off. If you find the fan hunting, lower the value of the 1M resistor. To clarify: The SET determines the temperature difference between the basement and upper house. The 1M (feedback) resistor determines the temperature difference between fan on and fan off a dead band that prevents hunting.

Grid Dip Revisited

Q. About the “Dip Oscillator Meter” in the January 2005 issue ... I pretty much have most of the parts, except for the variable capacitor. Do you know where I can find those vari- able capacitors?

James Ko via Internet

Weller

Solder Station 5 - 40 Watts

Head Magnifier With Light

Order#: WLC100

*3489

Combination glasses allow for extra $789 magnification

Order #: VTMG6

7 ntronics

^^^/l NCORPORATED ** ^

www. tritronicsinc. com

1306 Continental Drive - Abingdon, MD 21009-2334 1952 NW 93rd Avenue Miami, FL 33172-2925

Security Bit Set *889J

©

r®©

_

33 Pieces

Order #: VTBT5

1000 Asst. Cable Ties

Order#: K/TF1000

$989

Maryland 800*638*3328

Fax: 800-888-3293

Florida 800»365»8030

Fax: 800-999-3293

Ask for Our New Free Catalog!

Circle #68 on the Reader Service Card.

27

FEBRUARY 2005

Q&A

I know they are not easy to find but they are plentiful in old radios of all kinds. The best source is from antique radio sales, like Surplus Sales www.surplussales.com/ Variables/AirVariables/AirVar 1 . html (CAV) MAPC-50ME. Can’t afford these treasures, you say? Try the circuit in Figure 5.

In place of the mechanical variable capacitor is a semiconductor varactor diode. A varactor is a reverse-biased diode that changes capacitance with voltage. The greater the voltage, the lower the capacitance. FYI any diode can be used as a capacitor in the reverse-bias mode. The varactor

is special in that it has predictable characteristics. You may notice that the schematic isn’t complete I’ve just high- lighted the varactor section. For those readers who missed the original design, I’ve posted it on our website (www.nutsvolts.com) under

GRID_DIP.PDF.

Squelch the Squawk

a I have a smoke detector in the arage, but I cannot hear the beeper with the door shut. I tried using one of the Ramsey kits, “The Voice Switch (VOX).” When I use it with a relay and small siren, it works, but you have to reset it manually. Can you help me?

PeteThedoulou via Internet

Engineering

The technology builder's source for kits, components, supplies, tools, books and education.

Robot Kits For All Skill Levels

t

A -i

L IS*

i

i<*

is

Books and Educational Kits

BEAM Kits and Components

\ X

ICs, Transistors, Project Kits

Motors, Frame Components and Scratch Builder Supplies.

Order by Internet, phone, fax or mail. www.HobbyEngineering.com

1-866-ROBOT-50

1-866-762-6850 1-650-552-9925 1-650-259-9590 (fax) sales@HobbyEngineering.com 180 El Camino Real Millbrae, CA 94030 Visit our store near SFO!

Most orders ship the day received! World-wide shipping. Convenient payment options.

k . Think about it for a minute. The VOX is activated by the sound of the smoke alarm, right? So when the siren goes off, what does it produce? Louder sound sound that prevents the VOX from turning off. The best way to prevent this is to pulse the siren on and off to break the loop. This can be done using a car alarm that you can buy at an auto parts store or by using the circuit in Figure 6.

This is a simple 555 astable timer with an on/off time period of about two seconds that drives a relay (RadioShack 275-005) to pulse your siren. Not only does it break the feed- back path, but a pulsating alarm draws more attention than one that just screams. To minimize feedback from the siren, attach the microphone as close to the smoke detector as possible, maybe with duct tape. NV

Cool Websites!

fy0~y moth, I cdlect wdbsites that are cod, safe, and fin and publish then ina mothly newsletter

He~e, yaiwill find my past mothly newsletters. Mark Donaldson www.geocities.com/luem42/news letter.html

Take MSA interactive14 Planet

Quest” quiz to see if you know what is fact and what is sciereficti an

http://link.abpi.net/Lphp720041 1 23A6

Like games? See if you can bat my 9 second scare. I'm sure you can

www.bleacheatingfreaks.com/flash/

games/popoint.html?

28

FEBRUARY 2005

Create, Read and Write * to FAT1 6/32 files

Easy to use, simple protocol

Directories supported

Long filenames supported

Up to 4 files open, using file handles

SD/MMC Serial Data Module

uMMC

ROGU€

robotics

1-866-99 ROGUE

(416) 238-7054 Fax sales@roguerobotics.com |

www.roguerobotics.com

Everuthinq qou need to build qour oayn ...

mobile mamoT

fapilffis

WSmflfiite

Hffltes

IMapIMsaps

♦WtetemSp flan®

Zagros Robotics

PO Box 460342, St. Louis, MO 63 1 46 (3 1 4) 768- 1 328 info@zagrosrobotics.com

www.zagrosrobotics.com

Wireless A/V Transmitter/Receiver

140/kit

ASK-2008TR, 2.4, 1.7, 1.2 GHz, 8 Channel Wireless Systems

Transmit range up to 800' 12 Channel Available Built-in channel switcher for auto scan

1000 mW booster optional

ASB-2000 2.4 GHz Power

- Amplifies 2.4 GHz radio signal up to 1 W output

- 10-40 mW power input

- Size: 2" x 2" x 3/4" appr.

- Power Supply included

Mateo, Inc. www.matco.com Sales:(800)-71 9-9605 Fax: (847) -303-0660

Intronics, Inc. Tel. (913) 422-2094

Box 12723 / 612 Newton / Edwardsville, KS 66111 Add $8.00 COD

WWW.IN-KS.COM Visa/MC/Amex/Disc

SOIC PLCC SSOP QFP DPAK SOT23 MSOP QSOP SC90 D2PAK TSSOP SOT89 D3PAK SOT143 TSOP SC70 SOT88 and many more.

(714)630-8024 www.beldynsys.com

- Rapid Development Solutions for the Technical Professional -

LULULU.bsiD.U5

SCectftontcs Showcase

The Pocket Programmer Only $149.95

The portable programmer that uses the printer port instead of a internal card, with easy to use Windows software that programs E(E)prom, Flash & Dallas Ram.

Need same Logic Level I/D with Ljour PLC?

BSI0 16*1611

ISMT PROTOTYPING ADAPTERS!

Snap-Apart™ PCB's with .100" pin strips. Dozens of assorted adapters on each PCB.

A variety of PCB's with patterns front & back.

WMW.

com

PRINTED CIRCUIT BOARDS

Battery rebuilding service

Dead Batteries ? Don't toss them. Send them to us - our rebuilds are better than original specifications.

Electronics Radios

Bar Code Scanners Surveying Printers Laptops Photography

Visit www.primecell.com for important details

24 Hr Secure recorder tel-fax (814) 623 7000 Quotes email: info @ primecell .

Cunard Assoc. Inc. 9343 US RT 220 Bedford PA 1

IS

mi

Tools

Hilti Skil Milwaukee Panasonic B&D DeWalt Makita All 2-36 Volts

com

5522

QUALITY PRODUCT FAST DELIVERY COMPETITIVE PRICING

* UL approved

Single & Double sided Multilayers to 8 layer

* SMOBC, LPI mask

* Reverse Engineering

* Through hole or SMT

* Nickel & Gold Plating Routing or scoring

* Electrical Testing

* Artwork or CAD data

* Fast quotes

We will beat any competitor s prices!!!

yogii@flash.net -

1 0 pcs (3 days)

I or 2 layers $249 1 0 pcs (5 days)

4 layers $695

(up to 30 sq. in. ea.) includes tooling, artwork, LPI mask & legend

PULSAR, INC

9901 W. Pacific Ave. Franklin Park, IL 60131 Phone 847.233.0012 Fax 847.233.0013 Modem 847.233.0014

flash.net/~yogii

Design inspired by the Atari 2600, Apple II & Commodore 64!

INCLUDES :

XGameStation

Learn Step-By-Step How to Build and Design Your Own Vided Same Console!

9 volt adaptor

2 test leads

PC parallel cable

sampling frequency: ^

real-time: 1.25KHz to 50MHz"

repetitive: 1 GHz

spectrum analyzer

transient recorder

GREAT PRICES, GREAT SHIPPING RATES 49 McMichael St., Kingston, ON, K7M 1M8 CANADA

[Ht

Great tor Hobbyists AND Students!

■The Fun Way to Learn Embedded Systems!

Fully Assembled XGS Micro Edition Unit!

Complete Software Development Kit!

•Tools, Demos & Utilities! Powered by the Ubicom

eBook on Designing the XGS Console! SX52 @ 80 MIPS and

Cables and Power Supply Included! Parallax SX-Key Compatibli

WWW.XGAMESTATIDN.CaM

(925) 736-2D9B SUPPDRT@NURVE.NETT

Active Wire® USB Simple USB Interface!

Works with MacOS 8/9, Win98/2K/ME/XP FreeBSD and Linux!

24Mhz CPU core with USB Firmware downloadable via USB 16 bit parallel Input/Output See web-site for add-on boards All drivers, manuals, demos are on our web-site for immediate download!

$59

plus shipping

ActiveWire, Inc.

www.activewireinc.com

ph +1 .650.465.4000 fax +1 .209.391 .5060

Mold manufacturing.

Production of injection molded parts. No order too small or too big. Very competitive on high labor parts. For very small orders we can inject your parts on manual low pressure machines.

We manufacture our own tooling Site: www.vandvmachy.com email: victor@vandvmachy.com

USA Office: V &V Mach, and Equip. Inc. 1401 9 Whispering Palms Dr. Houston, TX 77066, PH. 281 397 81 01, Fax. 281 397 6220.

Mexico Plant: Marketing Tech. De Mex.SA de CV. Alamo 93 Cuarto Piso, Santa Monica,Tlal. Edo. De Mexico, 54040 Tels.01 1 52(555) 314 5325 & Oil 52(555) 360 3648 Fax. Oil 52(555) 361 5996.

Project

Q Q i

I ' •'

by Thomas Scarborough

Thte jM&nth’js "Projects

Wart Remover .... 30 AVR HyperTerm ... 36 It’s Time to Play! ... 44

fine pazzbaM Pafmg aSystervK

To find out the level of difficulty for each of thece project b, turn to Truzzball for the ancWerc.

The ccale ic from TA-y With four F^uzzbaWc being the more difficult on advanced projects. Ju^t look for the F^uzzbaWc in the opening header .

You'll alco find information included in each article on any cpeci a! tooic or cksjllc you’ II need to complete the project .

L *et the

col dering begin!

(A

£

|o8

i

l|

Z

30

Wart Remover

Skip the Doctor Visit!

NOTE: Consult your physician before using this product. Thoroughly discuss its use and precautions. The publisher and the author assume no liability for this product’s use or misuse.

The Wart Remover originally came about by accident. I had a local infection, which was thought to be “hiding” from antibiotics, and so I sought to treat it with Crane frequencies a range of electrical frequencies which supposedly destroy specific microbes.

Without knowing what voltage or current to apply, the treatment was surprisingly and completely successful. However, it caused a little damage to the skin. What if, I thought, Dr. Crane’s frequencies would cause similar damage to warts?

My first experiments met with some success, however, the results were patchy. There were unexpected failures which, at that stage, were not understood.

After designing five successive proto- types over a period of a year, I finally achieved the desired consistency and the final proto- type (described here) worked without fail on small- to medium-sized warts.

A number of prototypes were tested on several volunteers, as well as being loaned to two doctors. These achieved close to 100% success with the common wart (a brown or skin-colored, rough wart) and 100% success with the plane wart (a very flat wart).

This does not, of course, guarantee that the Wart Remover will work in every case. However, it does offer reason for hope that the device would be effective in a great many cases.

Medical History

During the 1950s, Dr. John Crane estab- lished that a frequency close to the one used in the present design was one ideally suited for treating warts and the wart virus. This frequency is used here with suitable voltage and current. However, since Crane frequencies may not be the full explanation for the Wart Remover’s success, the theory is discussed in more detail in the sidebar.

While researching this project, I found two Crane frequencies for warts (2.127 kHz and 21.27 kHz) and empirically settled on the higher frequency.

It has since been questioned whether Dr. Crane’s frequencies are at all significant or whether any frequencies within a few 100 or even 1,000 Hz would work just as well. I chose Dr. Crane’s original frequency and, assuming that this is optimal, close frequencies and harmonics might yield similar results.

Figure /. Block diagram of the Wart Remover.

12-24V

Voltage

Booster

5

12V Oscillator q 21.27kHz

-nr-K

Piezo

Sounder

"a

Dispersive

Electrode

Active

Electrode

Solid

State

Switch

7

FEBRUARY 2005

Wart Remover

It is interesting to note that Dr. Crane’s frequencies for cancer (sarcoma and carcinoma) lie close to those for warts. This raises the possibility that the Wart Remover might work for certain cancers. However, the Wart Remover would not be recommended in such a case, since one cannot afford to take chances with personal experiments on cancers.

Wart Removal Today

Removing warts has never been much fun and the use of the Wart Remover is likely to be painful but only briefly and not too much so.

One of the most common methods of removing warts is liquid nitrogen treatment (also called cryosurgery or “controlled frostbite”). However, this is both painful and messy. Not only that, but it may be counterproductive, in that it may worsen the treated warts in the long run. It sometimes does permanent damage to the skin (particu- larly darker skin) and poses a far greater risk of infection.

A more modern method of removing warts goes by the name electrodesiccation (or sometimes, “radio frequency thermal ablation”); that is, burning off warts electrically.

This is far more tidy and is quicker than the method presented here. However, it tends to be expensive and is unavailable to people in less developed or more remote areas of the world. Also, it typically uses 1 ,000 times more power than this circuit and could be dangerous to try to implement as an amateur project. The Wart Remover thus brings the destruction of warts within the scope of the amateur constructor.

As improbable as it may seem, the common wart may be destroyed with a simple circuit that uses a tiny key chain battery delivering a boosted 24 volts to the skin. Taking into account the resistance of the skin, this translates to just 100 juA or so passing through the wart internally, thus delivering a fraction (about 1/4) of the peak power delivered by a typical TENS unit.

For the price of a doctor’s consultation for the dreaded liquid nitrogen treatment or for the price of a single session of electrodesiccation, several Wart Removers could be built. Moreover, a single key chain battery should be sufficient to destroy as many as 40 or 50 warts.

Safety and Caution

Despite the very small currents used by this circuit, little is understood about the effects of electricity on the human body and the Wart Remover should be used with this caution in mind. In early experiments, while I was still seeking to establish the correct “exposure” required to destroy a wart, I caused temporary damage to a nearby fingernail, which “warped” until the fingernail grew out again. Similarly, an Internet site reported stiffness in a finger joint that was subjected to a related treatment.

These are relatively minor side effects, yet it should be

kept in mind that the Wart Remover is capable of doing some damage if misused. Therefore, the voltage, current, frequency, and duration of treatment described in this article should not be rashly modified. A year’s experimentation lies behind this design and most if not all of the mistakes have hopefully been made and addressed.

Practical Experience

During testing, virtually all common warts and plane warts were ultimately removed, but there were some differ- ences in the effect that the device had. In several cases, a wart was obliterated the first time, never to return. These were usually small, common warts, less than 4 mm in diam- eter. However, with close constellations of warts (at first glance looking like a single wart) or with larger warts, the wart was sometimes destroyed in part, but needed follow-up treatments (or a few treatments at once) to destroy all of it.

During testing, only one wart proved to be really difficult to remove; in this case, it measured a whole 12 mm across. After four treatments in quick succession, it was significantly reduced in size, but was still some way from complete destruction. This wart had, in fact, been worsened by liquid nitrogen treatment.

In almost every case, little or no pain was experienced when the Wart Remover was first applied, although one subject jumped when the device was first switched on. This should be avoided in this design with a small modification described later in this project.

After a certain period of painlessness, which varied from about 1/2 a minute to 3-1/2 minutes, subjects suddenly felt a burning or even “spine-chilling” pain inside and under the wart. This pain only lasts about half a minute, then subsides. However, it is necessary for the removal of the wart and needs to be endured. When the pain has subsided (or after 5 minutes, whichever may come first), the electrode is removed.

It should immediately be apparent that the wart is “just

31

FEBRUARY 2005

Project

Figure 3. The project is compact and can be built into a large pen casing.

not the same.” In fact, in many cases, the wart melted with a fizzle even before treatment was over. The skin immediately surrounding the wart may be irritated for a few hours and there may be a slight swelling around the wart.

Ultimately, a scab is likely to form and, perhaps three weeks after treatment, the wart should “expire” and come off or, in some cases, partly come off. Don’t remove a wart too soon or break its surface, since this could leave a deep wound and infection could represent a risk. If it is left alone, there should be no infection.

If a treatment should have little or no effect, it would be sensible to consult a doctor.

The Circuit

(O

b

£

!<*

IH

The Wart Remover uses a single 4060 CMOS oscilla- tor IC (see block diagram Figure 1), which incorporates a 14-stage binary divider. I chose this IC for its simplicity (it incorporates the oscillator), for the square wave outputs provided by its internal divider, and its ability to have three separate outputs employed for three separate purposes.

The fourth-stage output (pin 7) switches a solid-state switch (a power MOSFET) to pulse 24 volts through the electrodes at the required frequency. The fifth-stage output (pin 5) powers a voltage booster (12 to 24 volts see the top of Figure 1) and the sixth-stage output activates a peizo sounder that gives a direct indication that the oscillator-divider IC is working.

One of the electrodes is positive (+24 volts, called the dispersive electrode and labeled DE) and may either be a metal grip held in the hand or a metal plate applied to an area of skin near a wart. The other electrode is negative (0 volts, called the active electrode and labeled AE) and this is a sharp(ish) metal point used for direct contact with the wart.

I settled on a 24 volt, 21.27 kHz square wave (or thereabouts), applied to a wart for five minutes. I found that pulses of 1 mW power (minimum) passing through the wart internally were required to achieve any effect and that 3-6 mW pulses were adequate.

32

Current across the probes (see Figure 2) is limited by R4 to 2.4 mA (maximum) so as to protect the circuit if the probes should be short circuited. One needs to also factor in the conductivity of the flesh and this rarely falls below about 200K; therefore, little more than about 100 pA would course through the wart itself.

The frequency of the oscillator section is roughly cal- culated by the formula f=l/(2.2 x R1 x Cl), although this becomes undependable, in practice, at higher frequencies.

I selected the Philips HEF4060BP IC for Cl 1. Note that different makes of this IC can affect the frequency and, if a different make is used here, I would suggest that the frequency be adjusted with the help of a frequency meter (adjust the value of Rl). Having said this, frequency is unlikely to be critical.

Q1 provides an efficient switch for pulsing the voltage through the flesh and may be almost any power MOSFET. I used an IRF823 that I obtained in an All Electronics bargain pack presumably a high voltage device in the IRF series. The more common IRF510 would serve just as well. C4 serves as a supply decou- pling capacitor and SI as an on-off switch.

Some “trappings” are added for convenience and comfort. Most importantly, a 470K potentiometer is inserted in the dispersive (+24 volts) electrode’s lead to prevent the possibility of a brief electrical jolt at switch-on or on first applying the active electrode to a wart. In this case, the Wart Remover is switched on and the active electrode is applied, then VR1 is turned up (that is, its resistance is reduced). Further, an audible sign of life is added to the circuit by wiring a peizo sounder to the sixth-stage output. This uses a 100K series resistor so as to provide a gentle beep.

For those who are likely to use the device more often, a standard “battery low” circuit could also be added. Lastly, the fifth-stage output is used to raise the battery’s 12 volts to 24 volts by means of a standard voltage doubler. The circuit is thus directly powered by 12 volts, while a boosted 24 volts is switched through Q1 to the electrodes. Most importantly, this boosted voltage helps the circuit overcome skin resistance, so that it is able to provide the

FEBRUARY 2005

Wart Remover

Theory and Practice

Theory has it that alien cells, such as wart cells, begin to resonate when bombarded with a specific electrical frequency much as a peizo sounder resonates most intensely at its resonant frequency. Normal chemical processes at the cell boundary are thereby disrupted (or the cell ruptures), thus killing the cell. Healthy tissues are left relatively unscathed.

However, this is not the only theory in the running. By way of a process of elimination, I followed up further suggestions put to me by leading researcher Aubrey Scoon:

1 . Electrolysis. I found that electrolysis (using a “flat” DC voltage) also had a significant effect on warts; however, this did immediate superficial damage to healthy tissues, as well. My conclusion was that electrolysis may contribute to the destruction of warts, but does not offer an adequate explanation for the Wart Remover’s success.

2. Iontophoresis. This is the leaching of ions into the wart, which would effectively poison the wart. However, after experimenting with ferrous,

non-ferrous, and graphite probes all of which were tried with success this theory appeared to be ruled out. It also seemed to be contradicted by the sometimes spectacular action of the Wart Remover.

3. The stimulation of immunomodulatory chemicals. The theory is that these chemicals, when stimulated by an electrical frequency, attack the wart and destroy it.This, however, would seem hard to explain in light of the spectacular destruction of several warts, some of which fizzled up before my very eyes.

4. Frictional heating. Ionic agitation may raise the temperature within the wart, causing tissue coagulation. While I had no way of testing this theory, I thought it to be unlikely. Existing electrodessication equipment typically burns off warts with a few watts of power, raising the tempera- ture within a wart above the 47°C required for the denaturation of tissue proteins. However, since the Wart Remover pulses just one- thousandth as much power through a wart, this possibility was not considered a leading contender.

3-6 mW power necessary to destroy a wart internally. As the voltage is raised, the power pulsed through the wart increases, as is confirmed by the equation I=V/R.

The miniature 12 volt key chain battery used in the prototype (an MN21 or 23A) would be expected to last about 5-10 hours continuously, depending on the

make of the battery.

Construction

The Wart Remover is built on a printed circuit board (PCB) measuring approximately 2-1/2” x 1-1/2” (see

Surplus Sales of Nebraska

Min / Max Thermometer

(MTT) ITM-3-18A4

-40° F to 180° F. Analog device with a memory. Mercury free thermometer has adjustable set points on either side of the main indicator. As the temperature increases or decreases the set point is pulled along and remains until you observe and reset. 3” diameter dial. 5” long stem.

$10.00 each or 5 for $35.00

NVidia Graphics Card Cooling Fan

(FAN) MTHERM-1027B

NVidia graphics card cooling fan fits NVidia VisionTek. 3.26 cfm, 12 vdc, .09 amps. 2 pin connector.

Dimensions: 68mm x 60mm x 10mm high. Manufactured by Millennium. 26,000 are available!!

$6.00 each or 5 for $25.00

Split Beads

(ICH) 044-3164151B

Ferrite Split Beads are the best form of field applied prevention for RFI and EMI noise suppression available. All made with 43 material. Available in 3 sizes.

1/4” Bead with Cage 3/8” Bead with Cage 1/2” Bead with Cage

$2.75 each $2.50 each $6.95 per pair

Please visit our website with over 2,000 pages and 10,000 images www.surplussales.com

HI Manuals: 1 ,000s of radio, military and test equipment manuals on hand!!

Enclosures: Rack Cabinets, Builder Boxes, Shipping Containers

Variable Capacitors: Air - Mica - Vacuum

Tape: Fiberglass, Polyimide, Mylar®, Polyester Film

Ferrite: Rods & sleeves in many sizes.

*

Vacuum Tubes: Over 1,000,000 vacuum tubes in stock!!

Circuit Breakers: From .5 to 60 amps. - ---"i Rocker, Toggle, Pushbutton types

9

Ballantvne: Bodine projector motors.

Replacement Speakers: Many small sizes available.

i Collins Parts: For Amateur and Military.

p| Pressure Sensitive Labels: Cautions and “tqo Warnings

Andrew Connectors

O

%

1502 Jones Street, Omaha, NE 68102 Fax: 402-346-2939 e-mail: grinnell @ surplussales.com Visa, Mastercard, American Express or Discover Call or e-mail for shipping and total charges. All SPECIALS in this Ad only good for 30 day advertising cycle. No exceptions please.

www'su r pi ussa les. com 800-244-4567 402-346-4750

Resistors: Wire Wound, Carbon, Metal ■“ Film, Surface Mount

if*

%

Fans & Blowers: Over 100,000 In Stock! Muffin - Squirrel - Spiral

Frequency Sources: From 3KHzto 11GHz

33

FEBRUARY 2005

Project

Figure 3). As is seen from the photographs, the prototype could be built into a very small case. It should not be difficult, in fact, to redesign it to fit into an oversized pen.

Solder the battery holder to the PCB (two 8 mm crimp terminals), attaching a round head (No. 2) paper fastener to the negative (0 volt) crimp terminal. Alternatively, the battery may be soldered directly to the PCB by means of two solid-core wires; this must be done quickly to avoid overheating. Solder the six solder pins and the 14-pin dual-in-line (DIP) socket to the PCB. Take note of the DIP socket’s orientation. Solder the resistors to the PCB, the capacitors (take note of the orientation of C4), the diodes, and Ql.

Insert the PCB in the case as shown. Mount on-off switch SI on the case and connect it as shown (this should be switched off to begin with). VR1 is attached by an end terminal to the solder pin and its wiper is taken to the dispersive electrode, so that its resistance decreases when the shaft is turned clockwise. Peizo sounder XI is attached to the solder pins.

Drill a hole in the case next to the switch, through which the wire to the dispersive electrode (a metal grip or metal plate) will be passed. Make sure that there is a sound electrical connection with the metal grip or plate. Then drill a hole for the active electrode, which is inserted through the end of the case and soldered to the two solder pins. This probe may be a needle with its sharp

point filed off with a fine file to make a sharp (ish) stub.

Drill holes on the lid of the case for VR1 and the peizo sounder, gluing the sounder over the hole so that its sound escapes through the hole. Insert (J1 in the DIP socket, observing anti-static precautions (first touch your body to ground). The whole PCB, if desired, may be secured in the case with a little epoxy glue. Be sure to insert the battery the correct way in its holder, since the circuit has no reversed polarity protection; a mistake here could destroy the circuit. If there are any problems on completion, the first suspects should be Ql and (Jl.

In Use

A year of experimentation preceded the development of this circuit and the results gave me a new respect for the potential risks of electricity, however small the voltages and currents which are applied.

Skin resistance can vary between about 100K and 8M, depending on the day and the situation. Therefore, to ensure consistency of results, skin resistance needs to be kept relatively low. Use a little skin moisturizer where the skin makes contact with the dispersive electrode, as well as a little moisturizer on the wart itself.

Constructors are advised not to use the circuit where current would flow across the head or the heart and never in a case where a person uses a pacemaker or has any history of epilepsy. All the precautions that apply to a TENS device apply also to the Wart Remover.

When treating a wart on, for example, the lower or upper arm, hold a metal grip (the dispersive electrode) in the same hand. If it is not convenient to use a grip, rest the limb to be treated on a metal plate that is again connected as the dispersive electrode.

The active electrode, which is a sharp metal point (but not too sharp), is rested directly and gently on the top of the wart. If the wart is large (say 5 mm or more in diameter), it might be a good idea to tackle one or the other side of it first, since the Wart Remover is unlikely to kill all of it at once.

Switch it on and apply the Wart Remover to a wart for up to five minutes, then switch it off. If desired, use VR1 as described to avoid any initial jolt and be prepared to suddenly experience perhaps a minute of sharp pain. If you do not see this through until the pain subsides, the wart may not be destroyed.

The Wart Remover came as a welcome relief to my son, who couldn’t bear the thought of further treatment with liquid nitrogen. He claimed that the Wart Remover was far preferable and that the pain was “not bad” in comparison.

While this circuit comes with no guarantees, it is nothing ventured, nothing gained! With several willing “guinea pigs” and further volunteers queuing up, I found that the Wart Remover was entirely successful, most of the time. NV

%/%

£

08

Parts List

Resistors

Rl

5K ohms

R2, R3

I00K ohms

R4

I0K ohms

VRI

470K ohm miniature linear potentiometer

Capacitors

Cl

100 pF

C2

220 nF

C3

100 nF

C4

100 pF electrolytic 16 V

Semiconductors

D 1 , D2

IN400I

Ql

IRF823 (or IRF5I0, BUZI l,etc.)

Ul

HEF4060BP (or equivalent see text)

Miscellaneous

XI

Peizo sounder (without internal electronics)

SI

On-off switch

Bl

23 A or MN2 1 1 2 volt key chain (“remote”)

battery

Two 8 mm crimp terminals for battery holder Round head (No. 2) paper fastener for battery holder 6” long x 0.4” diameter brass pipe for dispersive electrode One yard insulated wire to dispersive electrode 1 .6” needle for active electrode

2-1/2” x 1-1/2” copper-clad board, small ABS plastic enclosure, four-pin dual- in-line (DIP) socket, epoxy glue, eight solder pins, solder, etc.

34

FEBRUARY 2005

QUALITY Parts FAST Shipping DISCOUNT Pricing

CALL, WRITE, FAX or E-MAIL for a FREE 96 page catalog. Outside the U.S.A. send $3.00 postage.

DIGITAL MULTIMETER

Right Tech 9202 Features found on more expensive meters including LCD readout with 0.8” high digits, a transistor and diode tester and audible continuity check- er. Overload protection and low battery indica- tor. Protective rubber jacket prevents acciden- tal damage. Includes test leads and battery. Ranges to: 1000 Volts DC 750 Volts AC 10 Amps DC

Resistance to 2000K Ohms

CAT# DMM-9202

each

10 for $9.25 each

16 CHARACTER X 4 LINE LCD WITH LED BACKLIGHT

Solomon Goldentek # LM1112SYL Module size: 3.43" x 2.36" :

Viewing area: 2.43" x 1"

Character size:

0.11" Wx 0.18" H.

5 x 7 dot character.

LCD type: STN yellow-green.

LED color: Yellow-green ^ 5 0

CAT# LCD-108 ^

5.6” B&W VIDEO MONITOR

Ideal for surveillance, rear-view camera in RVs and campers or portable recording monitor. Plug-and- play for most video cameras and recorders. RCA jacks for audio/video inputs and outputs. 320 line reso- lution. Brightness, Contrast, Vertical Hold adjustments. On/ off and volume controls. Can be run on battery power. Operates on 13.5 Vdc, 13 Watts. Includes 13.5 Vdc, 1 Amp wall adaptor for home use.

6.75" Wx 6.37" H x 8.50" D.

CAT# MTR-6 I each

$3 in

12 VDC 92 MM COOLING FAN

Papst Multifan #3312.

3.63" square x 1 .27" ball bearing cooling fan.

12 Vdc, (6-15 Vdc)

290 mA. Fiberglass reinforced plastic PBTP housing, PA impeller.

47.1 CFM. 3000 RPM.

12" 22 AWG leads. UL, CSA, CE, VDE.

CAT# CF-204 & O 5 0

each

10 for $3.25 each

0.56" DUAL 7-SEGMENT DISPLAY, RED C.C.

0.56" character height.

24 pin DIP socket.

Red C.C. Dual Digits.

CAT# TDC-565

i'1

H'

4 00

10 for 850 each

1 each

1 00 for 750 each

SOLAR CELLS w/ CHARGING CIRCUIT - 3 LED’S

Here's a great start for a solar cell project. From not-yet-assembled solar-powered garden lights, these assemblies include two glass photovoltaic cells mounted on a plastic base. Output is approximately 2.6 Vdc @ 25 mA in bright sunlight. Under the photocells is a bracket for a two cell rechargeable AA pack & a small circuit board with three red LEDs. There is a photoresistor on top of the panel between the solar cells to sense light and dark conditions. In day- light the cells charge the battery. When it gets dark, the LEDs light. These are working units but the batteries packs are old and may not take a charge. Our two AA cell nick- el-metal-hydride pack, CAT# NMH-2AA ($2.00 ea.) is a good replacement. Solar cell surface area: 3.78" X 1 .98". CAT# SPL-05

$4^

each

10 for $4.25 each 100 for $4.00 each

"BED-O-NAILS" TEST CLIPS

J.S. Popper "Bed-of-nails" clips with insulating boots on approximately 46" long leads. Bed-of- nails clips have multiple spikes in the middle of the clip

enabling measurement through insulated wire. The jaws at the front of the clip grab and hold securely to plugs or terminals. The leads are stranded copper litz wire with red and black woven cloth insulation. Leads were cut from new equipment and may require a crimp termi- nal to facilitate attachment. CAT# ALG-22

$5oo

each

10 for $4.50 each 50 for $4.00 each

4-28 VDC PIEZO BEEPER WITH VOLUME CONTROL

Shogyo #3650VC.

Solid-state audio indicator emits a medium-loud, high- pitched tone. Screwdriver adjustable trimmer on back device controls volume. Operates on 4-28 Vdc @ 6 mA. Black plastic face is 1 .45" diameter x 0.1 6" thick. 1 .25" diameter thread- ed mounting bushing with large plastic nut mounts in panels up to 0.5" thick. 0.187" qc or solder terminals. CAT# SBZ-365

each

10 for $3.50 each 100 for $2.75 each

FAN-COOLED 6-12 VDC MOTOR

Smooth, powerful DC motor with internal cooling fan.

Operates on 3-12 Vdc.

11,500 RPM @ 6Vdc,

1 .35 Amps. 1 .45" dia. x 2.25" long. 0.125" diameter flatted shaft is 0.7" long. Two threaded mount- ing holes on face of motor on 1" mounting cen- ters. Solder lug terminals. CAT# DCM-231

each

10 for $3.50 each 75 for $3.00 each

shop on-line www.allelectronics.com

ORDER TOLL FREE 1-800-826-5432

Cards

TJi

MAIL ORDERS TO:

ALL ELECTRONICS CORP.

P.O. BOX 567 VAN NUYS, CA 91408-0567

FAX (818) 781-2653 INFO (818) 904-0524

E-MAIL allcorp@allcorp.com

VISA

NO MINIMUM ORDER All Orders Can Be Charged to Visa, Mastercard, American Express or Discover Checks and Money Orders Accepted by Mail Orders Delivered in the State of California must include California State Sales Tax NO C.O.D Shipping and Handling $6.00 for the 48 Continental United States - ALL OTHERS including Alaska, Hawaii, P.R. and Canada Must Pay Full Shipping Quantities Limited Prices Subject to change without notice.

MANUFACTURERS - We Purchase EXCESS INVENTORIES... Call, Write, E-MAIL or Fax YOUR LIST.

FEBRUARY 2005

Circle #50 on the Reader Service Card.

35

Project

byG.Y.Xu

Play the AVR HyperTerm

Use This Tiny Gadget to Program AVR Micros, Then Use It to Demo Your Success

Are you looking for a programmer that fits in your wallet? It’s here! Figure 1 shows a tiny device programmer that is only the size of a business card, but can be used to program Atmel’s many AVR microcontrollers (MCUs). More importantly, it doesn’t use its own software to work, but instead uses the host computer’s existing software, a terminal emulation program. So only the programmer hardware and firmware need to be designed no software for the host operating system needs to developed or installed.

This feature not only simplifies the development process, but also makes the programmer independent of the host operating system. As a result, the programmer can be used on any host computer platform from Windows to Linux or Unix as long as the latter has a terminal emulation program. For Windows PCs, this pro- gram is called HyperTerminal; I will explain it more later.

The programmer also has an interesting feature: Its hardware resource can be used to demonstrate some sample programming results, so you don’t have to build your own test circuit. Such a unique feature is a great boon for users.

The AVR Advantages

Atmel’s AVR MCUs feature enhanced RISC (Reduced Instruction Set Computer) architecture offers the highest MIPS-per-milliwatt capability for the eight-bit MCUs that has been introduced to the market with a variety of derivatives. The demand for these MCUs is still growing.

Compared to the old eight-bit MCUs such as the 8X5 Is a major advantage for the AVR is that it can be programmed in-circuit. This is achieved by its SPI (Serial Peripheral Interface) programming approach. Any AVR MCU has an SPI serial port comprised of three pins (SCK, MISO, and MOSI) for in-system programming, among other features. This makes the AVR programming very simple and easy. We’ll see this in the next section.

Circuit and Operation

Figure 2 shows the schematic of the AVR Hyperterm programmer. It consists of only two chips: Dallas Semiconductor’s RS-232 transceiver chip DS275 (Ul) and Atmel’s 20-pin AT89C2051 microcontroller (U2). U3 is a 20-pin socket used to hold the AVR MCU to be programmed; it can be either AT90S1200 or AT90S2313.

Ul functions as an RS-232 signal level translator that translates the signal levels between TTL and RS-232 and vice versa. Dallas Semiconductor’s DS275 is used because it has an advantage over the MAX232 chip, since the latter is bigger (16-pin) and needs five electrolytic capacitors to work. Here, we don’t need a capacitor, but use a Schottky diode 1N5817 with DS275 for latch-up protection. Latch-up can occur if the power supply for DS275 has been discontinued while communication is still taking place. In that situation, the Schottky diode will first conduct (because it conducts at a much lower voltage 0.3 V) to protect the DS275. You can order the DS275 chip from Dallas Semiconductor/Maxim’s website at www.maxim-ic.com

U2 is the heart of this programmer that handles communication with the host computer and all program- ming chores. The AT89C2051 is chosen because of its wide availability and it is a “minimized” 8051, so many people are familiar with its instructions. It has 2 Kbytes of Flash memory to store the program code known as firmware. That is enough for our purpose and only four control pins (FI. 7 to FI. 4) are needed for AVR programming because of the SPI feature.

From Figure 2, we see that port pin PI. 7 is used to reset the AVR after power-up, PI. 6 generates the required clock signal for data transfer between 02 and 03, PI. 5 con- nects to the AVR’s MISO (Master-In-Slave-Out) to read data from the AVR, and PI. 4 outputs data to the AVR’s MOSI (Master-Out-Slave-In). Note that the AVR is a slave device

FEBRUARY 2005

Play the AVR HyperTerm

J1

©-

9VDC

VR1

78L05

T

C1 -r

IOOufJ^

D1

-Hr

J2XI

1N5817

2 l~~t 8

LED1^\

R1

330

20

C5_]juF

C2

2.2uF

1

11

TXOUT

U1

DS275

RXIN

DOUT

3

DIN

36864 MHz I 1

C4

27pF

XTAL

Vcc

RST

P17

P37

P16

RX

PI. 5

TX

PI. 4

U2

AT89C2051

XTAL2

XTAL1

GND

JJO

19

1

18

19

17

18

16

17

CR1

4 MHz

20

Vcc

20-PIN

ZIF

SOCKET

RESET

SCK

MISD

MDSI

U3

AT905 1200/23 13

X2 XI

GND

J_10

Figure 2. The AVR HyperTerm schematic.

during programming; it needs a crystal or ceramic resonator, CR1, for data movements.

Power supply for the programmer is drawn from a 9-12 V wall wart via a 78L05 voltage regulator to produce 5 V. Capacitor Cl is used for smoothing. C2 is for resetting CJ2. C3, C4, and the 3.6864 MHz crystal provide the micro with the required working frequency. LED 1 is used to indicate the circuit’s working status. C5 is for decoupling.

That is all there is to the programmer cir- cuit description. It’s quite simple, consisting of only two small chips. The AVR’s serial interface makes it easy to program and there are still alternatives for the circuit. For exam- ple, you can use a MAX232 if you don’t have a DS275 on hand; also, you can use another 8051 micro for CJ2 such as AT89C51/52 or P87C51/52. The only drawback is that these chips are bulky, but they work just fine.

Construction

The construction for this programmer is also quite flexible. Depending on what chips and materials you are going to use, you can build it different ways: on a solderless bread- board, a perforated board, or using a PCB (Printed Circuit Board).

For the people who prefer to build a permanent gadget, you can download the foil patterns of a double-sided PC board from the Nuts & Volts website at www.nutsvolts.com You can make your own PCB or get one from the source given in the Parts List. By inspecting Figure 1 and the PCB layout, it’s easy to identify each component’s location and orientation or polarity.

When inserting a diode or electrolytic capacitor into the PCB, care must be taken not to make a polarity error.

The AT89C2051 (02) must be programmed before mounting it on the board. The firmware is an Intel hex file

AVRTMP1A.HEX - which can be down- loaded from my website at www.geo cities.com/xumicro. You can “burn” this chip with the firmware file if you have an 8X51 programmer; otherwise, you can purchase it with the PCB.

For either building it on a perf- board or PCB, the basic principles are the same. Depending on your pro- gramming and financial considera- tions, it can be built in either a deluxe version or an economic version. For the deluxe version, use solder-tail IC

FEBRUARY 2005

sockets for chip Cl 1 and CJ2, but a 20-pin ZIF (zero insertion force) socket for the AVR MCCJ. Because the ZIF socket costs about $10.00, you can replace it with the regular

Figure 3. Adapter circuit.

-E

-E

-a

RESET Vcc XI SCK X2 MISD GND MDSI

H-

&

E

RESET Vcc

20H

E

SCK

TU

E

MISD

T|

E

X2 MDSI

m-

E

XI

n

E

m

E

33

E

33

E

33

.[To

GND

iT]

Figure 4. LEDAVR hook-ups.

+5v

LED1^^

37

Nuts & Volts

Project

20-pin socket, but that will compromise some flexibility.

After you solder all sockets and other passive components onboard and test each Vcc pin on the sockets to make sure that they actually deliver 5 V, remove power and mount the ICs. If everything goes normally, LED1 should light up after power-on.

It should be emphasized that this programmer when it is built as the deluxe version can program not only the 20-pin AT90S 1200/23 13, but also the eight-pin AT90S2323/2343 and the 40-pin AT90S8515. The only thing you need to do is build the appropriate adapters for them.

As an example, Figure 3 shows the adapter circuit for eight-to-20-pin conversion. Because each AVR uses four pins (* RESET, SCK, MISO, and MOSI) for its programming, transforming these pins from 20-pin sockets to eight-pin sockets makes it possible to program the eight-pin AVR, as they have similar architecture.

To actually build this adapter, you can use two pieces of small perfboards, one 20-pin wire-wrap socket (its pin legs should be 0.5” long), one eight-pin solder-tail socket, and some wires. First, insert each socket onto each perfboard and solder it in place. Then, use spacers or

38

standoffs and nuts to stack them together with the eight- pin socket on top and fix them. The perfboards should be cut small enough that the adapter can be easily plugged into the programmer’s ZIF socket.

Firmware Design Ideas

Once the hardware design has been made, the next and most time-consuming part is to design the firmware. That means to write the program for microcontroller (CJ2) to handle communication with the host computer and the programming chores of the AVR. A few important points must be outlined first.

The first task is to decide on the RS-232 communica- tion settings with the host. We chose a Baud rate of 9600 bps, eight data bits, none parity, and one stop bit. These are the commonly used serial communication settings: 9600 bps, 8N1.

When the programmer is powered up, it sends a start-up message to the host screen and displays a command menu like this (extracted from the assembly program):

DB ‘AVR HyperTerm Programmer’

DB ‘Commands:’, CR, LF DB AB: BlankCheck’, CR, LF DB AE: EraseChip’, CR, LF DB AW: WriteFlash’, CR, LF DB AR: ReadFlash’, CR, LF DB AV: Verify’, CR, LF DB AI: ReadlD(SignatureBytes)’, CR, LF DB ‘Enter your selection (press Ctrl key first)’, CR, LF

When six commands are defined for the AVR programming tasks, each begins with a control key (A). For instance, the user can press ctrl-B to BlankCheck the chip; if the result is shown as “This chip is NOT Blank,” then he/she can press ctrl-E to erase the chip, and so on.

These commands are complete enough to cover the AVR programming tasks; a command to read the chip ID also known as Signature Bytes is even included. For each task, a related Command Processing Routine must be written to process the detailed operations.

For simplicity, we chose to transmit/receive only ASCII characters between the host and programmer. The programmer expects to work with a TTY terminal. To control data flow between different speed terminals, we chose the commonly-used software scheme XON/XOFF for Flow Control.

Of the above six commands, only AW and AV involve the use of file transfer. We use an Intel Hex format ASCII file to program the AVR or to verify AVR Flash memory contents. Here, XON/XOFF flow control is extensively used during these processes. For example, data is sent byte-by-byte from the host and, when the programmer receives a byte to program (that may take

FEBRUARY 2005

Play the AVR HyperTerm

10 milliseconds), it sends an XOFF character to the host, so the host stops sending until the programmer has com- pleted this byte programming and sends an XON character to inform it. Then, the host continues data sending.

Setting Up HyperTerminal

It’s clear from the last section that properly setting up the HyperTerminal for our unique requirements is vital for the programmer to work.

The HyperTerminal program has many capabilities and many options, but we only utilize a few of them. More importantly, many of its “default” settings are NOT what we want. We must change them to match our programmer’s settings.

To find the HyperTerminal program on the PC, begin from the “Start” button, go to Programs > Accessories > Communications, where you can see the HyperTerminal icon, and double-click it. This opens a New Connection. The New Connection dialog box appears and prompts you to enter a Name for it. Type in any name (such as Xtm) and choose an icon, then click OK.

The next dialog box is Connect To. Here, you have to reject and click NO to many default settings: don’t enter any area code or phone number, but, rather, choose the “Connect using Direct to COM1” option and click OK.

Once you’ve chosen COM1, the Port Settings dialog box appears. Select Baud rate and other settings to match the programmer: 9600, 8-N-l; also, remember to select XON/XOFF for Flow Control (reject default “Hardware”). Click OK.

Now, we will deal with the HyperTerminal window displays, but not everything has been set up. Click the File menu under the title bar; find the item Properties. Click it and you’ll see the “Settings” tab within the Properties. You need to change two items in it: Choose “TTY” for the Emulation type and then, in the ASCII Setup menu, put a check mark in the box for “Send line ends with line feeds.” Click OK. You’re finished with Terminal set-ups.

Using the Programmer

After setting up HyperTerminal, you can connect the programmer to COM1 of your PC and power it up. Then, you’ll see the following start-up message appear in a window:

AVR HyperTerm Programmer Commands:

AB: BlankCheck

AE: EraseChip

AW: WriteFlash

AR: ReadFlash

AV: Verify

AI: ReadlD(SignatureBytes)

Enter your selection (press Ctrl key first)

Now, press ctrl-B. If you can see a response after a while, that means the programmer is working. Then, perhaps, press ctrl-R to read the Flash memory; it will display 100 bytes of memory contents on the screen. If you see that not all bytes are FF FF..., that means the chip is not blank. You can press ctrl-E to erase it. Press ctrl-B to make sure that it really confirms as blank.

Then, we come to the most important task: writing Flash memory or programming. The bytes to be written should be stored in an Intel Hex file. Atmel has a free assembler program called AVRASM.EXE, which is used to generate the hex file from an assembly source program. You can download AVRASM.EXE from Atmel’s website (www.atmel.com). A brief description on how to use the AVRASM assembler follows.

For example, if we want to use the AT90S2313 in a circuit to light up an LED with 1 Hz frequency or 60 blinks/minute, then we can use a text editor (such as EDIT.EXE under Windows) to create the assembly program LED 1 AVR. ASM, as shown in Listing 1. Then, invoke the AVRASM assembler by typing the following command:

Parts List

Cl 100 mF 16 volt radial electrolytic capacitor

C2 2.2 mF 16 volt radial electrolytic capacitor

C3, C4 27 pF ceramic capacitor

C5 0.1 mF ceramic capacitor

Rl 330 ohm 1/4 watt carbon resistor

Ul RS-232 transceiver DS275 by Dallas Semiconductor

U2 AT89C205I Flash microcontroller (programmed)

U3 AT90S 1 200 or AT90S23 1 3 AVR to be programmed

VRI 78L05 voltage regulator 1C

J I Power jack

J2 DB9F connector

D I Schottky diode IN58I7

LED I General-purpose light emitting diode

XTAL 3.6864 MHz crystal

CRI 4 MHz ceramic resonator

Miscellaneous: 9- 1 2 VDC wall wart power supply, wires, solder, etc.

NOTE: The following items are available from G.Y. Xu, P. O. Box 14681, Houston, TX 7702 1 Phone: (713) 741-3125

1 . Assembled and tested AVRTMP- 1 programmer $34.95

2. Kit only $29.95

3. PCB and programmed AT89C205 1 $10.00

Please visit www.geocities.com/xumicro for ordering information.

39

FEBRUARY 2005

Nu¥s&Volts

16 bit analog development with a PIC 16F876

for precision

instrumentation applications

RJL Systems has a 25 year history in medical devices and is proud to announce an analog development board for engineers and hobbyists who demand accurate signal processing for display and communications.

Bipolar 16 bit ADC (+/- 1.5000 volts FS 100K SPS)

Isolated 8 channel analog mux (single ended)

Isolated power supplies (+/- 5.0V analog and 5.0V digital) Isolated 9 digital PIC I/O pins with buffered LED indicators Hard wired development area with access to all power Isolated RS-232C communications (1 15.2 Kbps max)

4 line X 20 character (blue) display with white LED In-circuit programming and debugging (RJ-12 connector)

CCS PIC-C sample code and schematics provided (CD ROM) Operates from any battery or bench 6 to 12 VDC power supply Screw terminals for convenient wiring to external devices

RJL Systems, Inc.

33955[Harper Aye.

Clinton Twp, MI 48035

1-800-528-4513 www.realanalog.com

Project

References

Eight-bit RISC Microcontroller Data Book, Atmel Corp., 1999.

Xu, G.Y.,“8X5 1 EPROM/Flash Microcontroller Programmer,” Circuit Cellar Magazine, April 1 998.

C: > AVRASM -I LED1AVR.ASM LED1AVR.LST LED1AVR.HEX

This command generates a listing file LED1AVR.LST and Intel Hex file LED1AVR.HEX, which is what we need for programming and is shown in Listing 2.

To write AVR Flash memory, first press ctrl-W, then go to “Transfer” menu in HyperTerminal, and click “Send Text File.” Enter the file name LED1AVR.HEX in the dialog box and press <enter>. In a moment, the text file transfer and programming will take place and the progress is shown on screen. Finally, you’ll see the “Programming Completed” message.

To verify the programming, use almost the same proce- dure as Writing, but this time first press ctrl-V and then go to the “Transfer” menu and do the same “Send Text File” process. Once you type in a text file name and press <enter>, that file is sent to the programmer and compared with the memory contents being read. If every byte compar- ison is okay, a “Verification Successful” message displays.

On some desktop or laptop computers, things may not be going so well. If that happens, you may need to redo something on the File menu. For example, if you can’t program all bytes correctly or some bytes are shown as missing when read, then you may need to go back to File > Properties > Settings > ASCII Setup, and put a 1 millisecond delay on both the Line Delay and Character Delay boxes.

Figure 4 shows how to physically hook up the LEDAVR circuit to demonstrate your programming results. This circuit can be mounted on a solderless breadboard. We also provide another program called LED2AVR.HEX to light up the same LED, but with a double blinking feature. You can try it out after programming with LED 1 AVR. HEX.

You don’t have to hook up any circuits, though, just use the programmer itself to demonstrate your success. Note that both the 20-pin socket CI2 and CI3 have the same Vcc and GND pins, in addition to the same Reset (pin 1), Oscillator (pins 4 and 5), and LED connect, pin 11. So, after programming, simply remove the AT89C2051 from the socket and replace it with the programmed AT90S 1200/23 13. Then, power-up and you’ll see the LED blinking or double blinking. This feature of the program saves you time and money. NV

About the Author

G.Y. Xu is an electrical designer specializing in microprocessor! microcontroller systems design and development, both in hardware and software. He can be reached by Email at gyxu@cmpmail.com

40

FEBRUARY 2005

Earn an Associate Degree

Cleveland Institute of Electronics

Electronics & ComputerTraining Programs

Nationally Accredited

Affordable Tuition / Military Tuition Assistance

from HOME!

Cleveland Institute of Electronics offers distance learning programs that will prepare you for rewarding careers in Electronics Engineering or Computer Technology

- even if you have no experience!

CIE's courses allow you to learn new technology at your own pace, in your own home, without disrupting your present job or lifestyle.

No prior experience is needed and you can do all your training at home with full instructor support, extensive learning labs and on-line exams.

They're fast, convenient, affordable and quickly becoming the new way to earn an accredited degree.

CIE's Distance Learning Programs

Electronics Associate Degree

Computer Associate Degree

Basic Electronics with Lab

Advanced Electronics Troubleshooting with Lab

Electronics Technology with FCC Preparation

PC Troubleshooting

Computer Networking

Wireless Technology

COMING SOON!

Industrial Electronics with PLC Technology

Send for your FREE CIE course catalog and take the first step toward building a successful career in electronics and computer technology. You'll find it has many rewards!

Cleveland Institute of Electronics 1 776 E. 1 7th St, Cleveland, OH 441 1 4

can (800) 243-6446 or visit www.cie-wc.edu fora FREE Career Catalog!

CD ROM & Certificate Training - CIE Bookstore

Introduction to Multimeters

2 meters 4 lessons 1 3 experiments 02-069 (Pictured) cert $195

FCC License Prep Course

1 9 FCC prep lessons on CD ROM. 01-FCC01 (cert) $49.95

Fiber Optics Course with Lab

2 lessons Lab Video Certificate 01-FB02 $175

Introduction to Computers

9 lessons certificate 01-IN01 $195

Basic Electronics Course

39 lessons 2 labs 53 exercises 03-lntrob (cert) $225

Oscilloscope Course

7 learning topics software 01-SCP01 (cert) $95

Soldering Course with Lab

3 lessons dab *video

01- SD01 (cert) $195

PC Board Design with Lab

4 lessons* lab* CD ROM

02- 261 (cert) $195

Intro to Information Systems

9 lessons certificate

01-CET1 1 1 $195

FREE CIE BOOKSTORE CATALOG www.ciebookstore.com (800) 321-2155

FEBRUARY 2005

Circle #31 on the Reader Service Card.

Rock stable PLL synthesized

Front panel digital control and display of all parameters!

professional

fm stereo transmitter

Ring In The New Year With A Ramsey AM/FM Broadcaster I

Professional f M Stereo Radio Station

Digital FM Stereo Transmitters

Rock stable PLL synthesized

Front panel digital control and display of all parameters!

Professional metal case

Super audio quality!

25mW and 1 W models!

For nearly a decade we've been the leader in hobbyist FM radio trans- mitters. Now for 2005 we introduce our brand new FM30 series of FM Stereo Transmitters! We told our engineers we wanted a new technology transmitter that would provide FM100 series quality without the advanced mixer features. They took it as a challenge and designed not one, but TWO transmitters!

gJgTnn^BThe FM30 is designed using through-hole technology

L -B,and components and is available only as a do-it-yourself

kit, with a 25mW output very similar to our FM25 series. Then the engineers redesigned their brand-new design I using surface mount technology (SMT) for a very special ll factory assembled and tested FM35WT version, with 1 W

output for our export market! Both are designed

around an RF tight vinyl clad metal enclosure for noise 8 free and interference free operation. All settings are

done through the front panel digital control and LCD | display! All settings are stored in the non-volatile mem- ory for future use.

I Both the FM30 and FM35WT operate on 13.8 to 16VDC and include a 15VDC plug in power supply. The stylish metal case measures 5.55"W x 6.45"D x 1.5"H and is available in either white or black. (Note: The end user is responsible for complying I with all FCC rules & regulations within the US, or any regulations of their respective I governing body).

FM30 Digital FM Stereo Transmitter Kit, 0-25mW White 5199.95

FM30B Digital FM Stereo Transmitter Kit, 0-25mW, Black 5199.95

FM35WT Digital FM Stereo Transmitter, Assembled, 1 W, White 5299.95

| FM55BWT Digital FM Stereo Transmitter, Assembled, 1W, Black 5299.95

I

Super audio quality!

25mW and 1 W models!

Our FM100B is the updated version of a truly professional fre- quency synthesized radio transmitter station in one durable, handsome cabinet. It is used all over the world by serious hobbyists as well as churches, drive- in theaters, and schools. No one else offers all of these features at this price! The included frequency display and audio level meters assist in easy operation. The "B" version now includes some additional functionality including a line level monitor output, improved stereo separation, spectral purity, audio clarity, and adjustable RF Output. An exclusive selectable microphone mixer and auto AGC circuit combines your local mic audio with your music input or mutes the music when mic audio is present. You don't even need an external mixer!

Sound quality is impressive; it rivals commercial stations. Low pass input filtering plus peak limiters put maximum "punch" in your audio, and prevent overmodula- tion distortion. No wonder everyone finds the FM100B to be the answer to their transmitting needs... you will too! The kit includes a sharp looking metal cabinet, whip antenna, and built-in 1 10/220 volt AC power supply. An external antenna con- nection allows hook-up to high performance antennas like our TM100 and FMA200. We also offer a high power export version of the FM100B that's fully assembled with I one watt of RF power for miles of program coverage. Many islands and villages use it as their local radio station! The export version can only be shipped outside the USA, or within the US if accompanied by a signed statement that the unit will be exported. (Note: The end user is responsible for complying with all FCC rules & reg- I ulations within the US, or any regulations of their respective governing body).

FM100B Super-Pro FM Stereo Radio Station Kit, 5uW-25mW 5269.95

FM100BEX High Power Version, 5 uW-1 Watt Output 5349.95

FM100BWT High Power Version, 5uW-lWatt, Factory Assembled 5429.95

Professional Synthesized Stereo FM Transmitter

Fully synthesized 88-108 MHz for no frequency drift

Line level inputs and output

All new design, using SMT technology

Need professional quality features but can't justify the cost of a commercial FM exciter? The FM25B is the answer!

A cut above the rest, the FM25B features a PIC microprocessor for easy frequency programming without the need for look-up tables or complicated formulas! The transmit frequency is easily set using DIP switches; no need for tuning coils or "tweaking" to work with today's 'digital' receivers. Frequency drift is a thing of the past with PLL control making your signal rock solid all the time - just like commer- cial stations. Kit comes complete with case set, whip antenna, 120 VAC power adapter, 1/8" Stereo to RCA patch cable, and easy assembly instructions, and the SMT parts are factory preassembled - you'll be on the air in just an evening!

Professional Synthesized AM Radio Transmitter

Fully frequency synthesized, no frequency drift!

Ideal for schools

Microprocessor controlled

Simple settings

Run your own radio station! The AM25 operates any- where within the standard AM broadcast band, and is easily set to any clear channel in your area.

It is widely used by schools - standard output is 100 mW, with range up to Va mile, but is jumper settable for higher output where regulations allow. Broadcast fre- quency is easily set with dip-switches and is stable without drifting.

The transmitter accepts line level input from CD players, tape decks, etc. Includes matching case & knob set and AC power supply!

FM25B Professional Synthesized FM Stereo Transmitter Kit

5139.95

AM25 Professional Synthesized AM Radio Transmitter Kit

599.95

Tunable FM Stereo Transmitter

Tunable throughout the FM band, 88-108 MHz

Settable pre-emphasis 50 or 75 pSec for worldwide operation

Line level inputs with RCA connectors

The FM10A has plenty of power and our manual goes into great detail outlining all the aspects of antennas, transmitting range and the FCC rules and regulations. Runs on internal 9V battery, external power from 5 to 15 VDC, or an optional 120 VAC adapter is also available. Includes matching case!

Tunable AM Radio Transmitter

Tunes the entire 550-1600 KHz AM band

100 mW output, operates on 9-12 VDC

Line level input with RCA connector

A great first kit, and a really neat AM transmitter! Tunable throughout the entire AM broadcast band. 100 mW output for great range! One of the most popular kits for schools and scouts! Includes matching case for a finished look! The AMI has been the leading Scouting project for years and years. Try out your kit skills and at the same time...get on the air!

FM10C

FMAC

Tunable FM Stereo Transmitter Kit 1 10VAC Power Supply for FM10C

544.95

59.95

AMI C AC125

Tunable AM Radio Transmitter Kit 1 10VAC Power Supply for AMI C

534.95

59.95

Tru-Match FM Broadcast Antenna

We've been besieged with calls asking us where to get a good quality FM Broadcast antenna. Remember, matching your anten- na to your transmitter is the single most important link in your transmitter setup - and a good antenna and match are the secret to getting maximum range.

Fully weatherproof-rugged PVC construction

Matches 50 or 75 ohm systems

Tunable for a perfect match over the entire 88-108 MHz FM band

I When we say "match" we mean electrical impedance match... if the proper impedances are not main- 25 watt RF power maximum tained between transmitter and antenna, power is reflected away from the antenna and back into the

transmitter! This can cause the final amplifier stage to be damaged, not to mention spurious signals and lousy range. Don't forget, there are three important factors in your broadcast range: antenna, antenna, and antenna! Buy this kit and get the most from your FM Broadcaster!

TM100 Tru-Match FM Broadcast Antenna Kit

569.95

What’s New For 2005

The Newest Neatest Stuff!

Eunmn

DDS and SMT technology!

0 Hz to 5 MHz at 0.1 Hz resolution!

0 to 1 0V peak to peak output level

Sine, Square, or Triangle waveform

Following our world famous SG550, we are proud to introduce the SG560, the next generation signal generator!

To begin with we increased the frequency range all the way up to 5MHz and all the way down to 0Hz (yes, we mean zero...or DC!) continuously in 0.1 Hz steps across the entire range! Then we gave it a variable output level all the way up tc

10V peak to peak in either Sine, Square, or Triangle waveforms! You can also pro- vide a DC offset to the output to recreate TTL, 4000 series logic levels, low voltage I logic levels, AC waveforms with a DC component, or just plain AC signals!

and reliability. If you're looking for a lab quality sig gen at a super the brand new SG560 fits the bilL.and a whole lot more!

SG560WT Audio/RF Signal Generator, Factory Assembled

Hand Held Digital Scope With DVM Readout

Digital waveform and measurement display!

10MHz and 40MHz sample rates!

Backlit LCD display

RS232 output (40MHz model only)

Charger, case, probes included

I We've seen a lot of portable scopes and scope/meters, and we've j also seen the price tags! They have always been way out of the reach and budget of the hobbyist. No more! Now for close to the price of a good DMM you can have a personal scope that also has DVM readout for dBm, dBV, DC, and True RMS!

Frequency readout is also displayed on the screen through | markers, plus the scopes have two memories for digital storage. \

te per hobfr

iyist price,

5329.95 I

. The 40MHz model also includes an RS232 output and serial inter- }. _ /I face to capture the screen display on your scope to your PC at the

J mere push of a button! These scopes run on 5 standard AA

mil

rn-| -MUj^ IIICIC PUSH

EB.rW:::^ Alkaline batteries (not included) which provide up to 20 hours of use. You can also use rechargable AA NiMH batteries instead and they'll be charged with the included power supply! Both units come with a cus- tom foam lined high impact carrying case, set of nigh quality scope probes, AC power adapter ana a comprehensive user's manual. If you're working with elec- tronic circuits, automotive applications, audio and stereo applications or other applications, the personal scope is for you...at a price that can't be beat!

I HPS10SE HPS40

Personal Handheld 10MHz Digital Scope Personal Handheld 40MHz Digital Scope w/RS232

$229.95

5299.95

Dual Display DMM With RS232 Output

RS232 output to your PC!

Digital and analog bargraph display

Backlit LCD display with data hold

Manual and auto ranging

Includes probes, RS232 cable, & software

I We gave you an inexpensive pocket DMM for under 20 bucks. Then we gave you a super multi-purpose professional multimeter that measured virtually everything for 40 bucks. What's next, you ask? You won't believe it! Everything PLUS RS232 serial data output for connection to your PC! That's right, now you can measure, control, and store your DMM anaits readings on a graphical display on your PC!

Features both auto and manual ranging with a large 3% “digit display with a 38 segment analog bargraph. Selectable backlight and data display hold features are also included. Plug in the provided DB9 serial cable to your PC, load the included software, and you're off and running with a remote control digital multimeter from your PC! Includes standard test probes, temperature test probes, professional rubber holster, RS232 cable, installed 9V battery, Windows software CD, all in a neat travel case. (Hard to believe for I $85 isn't it!!)

DVM345DI Dual Display DMM With RS232 Output

Get The Catalog!

^3^ Get the brand new 2005 Ramsey Hobby r Catalog! 64 value packed pages of the -neatest goodies around! Order your otgjL ^£icopy on-line or give us a call!

Metal Detector Wand

I Professional Quality

Just like at the airports, this hand | held metal detector wand detects the smallest metal objects hidden in both people and packages. Rocker switch turns the unit on and power is indicated with a green LED.

When metal is detected, a red LED is illuminated along with an alert tone. Headphone jack is provided for private security L checks. Runs on a standard 9 V battery and includes a case & strap. Factory assembled & tested.

ICSIOMD Security Wand $54.95

Sound activated |

electroluminescence! |

Now this is neat stuff! ]# 1

Nearly 10' of electrolumi- /r nescent wire to install in > S your car. BUT...it gets f-

better! A built-in sensor r modulates the EL wire to Sr" the beat of music! Can be set for full mode, music mode, or off.

Plugs into 12VDC car jack. Fully assembled.

NWRR30 Red EL Kit

$27.95

NWRG30 Green EL Kit

$27.95

NWRB30 Blue EL Kit

$27.95

Electronic Watch Dog

Stereo Super Ear

Sound activated barking dog on a PC board!

It's nice to have a barking dog to react to someone at | our door. But not all of us can have a dog! No prob- lem there, build your own!

Two distinct barking sounds are sound activated f| with a built-in microphone that has adjustable sensitivity. I wish my dog had adjustable sensitivity! This dog eats 9-1 2VDC. Easy kit assembly.

Amplifies sound 50 times!

I The "Super Ear" *>?*£

I is an ultra high -W*’

I gain amplifier that!

I includes two super I sensitive mics at a 45 ] degree angle to give )

| a true stereo output.

| Includes on/off switch and volume control. Standard audio jack is provid- ed for audio output. Runs on 3 stan- dard AAA batteries (not included).

Easy to assemble and fun to use!

K2655 Watch Dog Kit $32.95 MK136 Super Ear Kit

$9.95

Electronic Learning Labs

PL1 30

PL500

Learn and build!

130, 300, & 500 In One!

Super comprehensive training manuals!

Whether you want to learn the basics of electricity, the theory of electronics, or advanced digital technology, our lab kits are for you! Starting with our PL130, we give you 130 different electronic projects, together with a comprehensive 162 page learning manual. A great start for the kids...young and old!

Step up to our PL300, which gives you 300 separate electronic projects along with I 165 page learning and theory manual. The PL300 walks you through the learning phase of digital electronics.

If you're looking for the ultimate lab kit, check out our PL500. Includes a whop- ping 500 separate projects, a 152 page starter course manual, a 78 page advanced course manual, and a 140 page programming course manual!

PL500 covers everything from the basics to electronics and digital technology the fun way an^

The

ramming! Learn about 1 some neat projects!

PL130

PL300

PL500

130 In One Learning Lab Kit

300 In One Advanced Learning Lab Kit

500 In One Super Learning Lab Kit

$42.95

$69.95

$169.95

MORE than just friendly on-line ordering!

Clearance Specials, Ramsey Museum, User Forums, Dealer Information, FAQ’s, FCC Info, Kit Building Guides, Downloads, Live Weather, Live Webcams, and much more!

www.ramseykits.com

800-446-2295

ramSEU Where Build It!

www,ramsevkit$,wm - .

www, rQmsQykits, com

590 Fishers Station Drive Victor, NY 14564 (800) 446-2295 (585) 924-4560

Where Electronics Is Always

FUN!

Build It!

Learn It!

Achieve It!

Enjoy It!

Circle #79 on the Reader Service Card.

Prices, availability, and specifications are subject to change. Visit www.ramseykits.com for the latest pricing, specials, terms and conditions. Copyright 2005 Ramsey Electronics, lnc...so there!

Project

by Donald Bartley

It’s Time to Play!

Stamp Pong With the ezVID and BASIC Stamp 2

When I got my first computer in the early 80s, there was an immediate attraction. Hours and hours of playing turned into weeks and weeks, which turned into months and months. I was hooked. Once I had the language down, the first thing I wanted to do was write a game. For my first game, I thought big. It was going to be the game of games. I spent weeks writing the code on paper. (I didn’t have a storage device at the time, so I had to write my programs out completely and then type them into the computer in their entirety.)

Anyway, the day came when the program was done and I spent all night typing it in. At 2 o’clock in the morning, I was about 80% complete and my VIC-20 gave an out of memory error. I played the game as far as I could and it was still magical. The lesson to be learned was to write efficient code. That was not my last game or my last computer. That love affair has gone on for many, many years. I ended up in hardware with an electrical engineering degree, but I sometimes think about those old programming days.

Recently, while working on a project, the ezVID was created (by accident, of course). When I first saw the prototype of what was going to become the ezVID, I thought about some interesting possibilities. I have been

using microcontrollers both personally and professionally for some time. One of the microcontrollers I like to play with is the BASIC Stamp 2. Could this new prototype be used with the BASIC Stamp 2? Could this be a microcontroller video card? Could the BASIC Stamp 2 handle game code and graphics? Could it be as fun as it was programming my first game into my first computer?

When the ezVID was completed, the final product sported a resolution of 188 x 254 with 14 different colors. There was a ton of custom character memory 256 possible which is needed for any good game or graphics program. To handle all the basic stuff such as letters, numbers, punctuation, and basic symbols the ezVID comes with a standard, built-in library of 63 characters. It has an asynchronous TTL level serial interface, power connections (+5 VDC and common that the user has to supply), and a standard RCA style jack for the video output. The video output is NTSC non-interlaced composite video and is com- patible with any television, VCR, RF modulator, or any other piece of equipment that accepts this type of video input.

Where to Begin!

Now that it was all together, what game should be made first? It was obvious after a few moments of thinking that the answer has to be Pong. Pong looks about as basic as a game can get, but it does have a good handful of condi- tionals that have to be monitored and if you really want to get serious the laws of physics can be programmed into it to give the ball deflection vectors based on what angle it hits a wall or paddle.

For the BASIC Stamp 2 version, the laws of physics will have to be left out and only the conditionals will be looked at, along with ball speed increments, to make game play harder as you go.

To play games, it takes a little more than an ezVID and BASIC Stamp 2. The main ingredient that’s missing is a game controller. Every game you play has some form of user input, whether it is a

Figure I. Schematic for Stamp Pong.

+5V

+5V

%/%

£

I08

I

V

44

FEBRUARY 2005

It's Time to Play!

game paddle, joystick, or just a few buttons.

For Pong, the interface of choice is a paddle.

The complete schematic, including the paddle, is shown in Figure 1 . The game paddle for this system has to be made. This is an easy job that requires only a IK ohm potentiometer,

SPST normally open momentary switch, enclosure, knob, and a cable to connect it to the BASIC Stamp 2. Refer to the photo of a sample paddle in Figure 2. However you build your paddle, make sure that it is wired so that a clockwise rotation increases the resistance between the two terminals you are using and a counter-clockwise rotation decreases the resistance.

Once you have your paddles completed, you can assemble the hardware. Following the schematic in Figure 1 and the Parts List, you can build your proto-board very easily. The proto-board does not have the interface for the BASIC Stamp 2 to communicate with the PC, so you will have to download your BASIC Stamp 2 code prior to placing it in the Stamp Pong proto-board. A picture of a completed Stamp Pong proto-board is shown in Figure 3.

Getting Started

Before you can start writing any exciting game code, we must first explore the basics. In this case, that is communicating with the outside world which is the ezVID and the game paddle. Once this code is in place and working you can make them into subroutines and call them whenever needed in your code.

Let’s first take a look at the ezVID and its commands. It is important to note that, for these examples, it is assumed that PI 4 of the BASIC Stamp 2 is connected to pin 2 of the ezVID and PI 5 of the BASIC Stamp 2 is connected to pin 3

of the ezVID, as in the schematic in Figure 1. In the sample code, you will see that SEROCJT is the main command used and it is set up to send data through pin PI 5 at 9600 baud (non-inverted) with a 1 mS pause between each byte of data. The 1 mS pause in the command is used to adhere to the ezVID timing characteristics. When you send the ezVID a byte of data, you must first wait for an acknowledgment (ACK) return before you send another one. If you send another byte before receiving the ACK, the data will be lost.

The manual for the ezVID states that the ACK will be returned a minimum of 139.68 nS to a maximum of 663.56 pS after the stop bit of the data packet being sent is received. Putting the 1 mS delay between each byte ensures that enough time has passed for the ezVID to receive the byte of data and start sending its ACK before sending another one. PAUSE 1 usually follows SEROCJT (except change background color, clear screen, and reset). This is to allow enough time for the ezVID to ACK the last byte sent.

The last command normally used, PULSIN, is a way to tell that the ezVID is ready for another command (not needed when changing background color, clearing the screen, or resetting). Once the last byte is ACKed by the

Order online at: www : melabs. com

Development Tools for PICmicro MCUs

miaoGLnrpneering £iabs,

Phone: (719) 520-5323 Fax: (719) 520-1867 Box 60039

Colorado Springs, CO 80960

LAB-X Experimenter Boards

Pre-Assembled Board Available for 8, 14, 18, 28, and 40-pin PIC MCUs 2-line, 20-char LCD Module 9-pin Serial Port Sample Programs Full Schematic Diagram

Pricing from $69.95 to $349.95

PICProto Prototyping Boards

Double-Sided with Plate-Thru Holes Circuitry for Power Supply and Clock Large Prototype Area Boards Available for most PIC MCUs Documentation and Schematic

Pricing from $8.95 to $19.95

BASIC Compilers for PIC MCUs

Easy-To-Use BASIC Commands Windows 9x/Me/2KJXP Interface

PicBasic Compiler $99.95

BASIC Stamp 1 Compatible Supports most 14-bit Core PICs Built-In Serial Comm Commands

PicBasic Pro Compiler $249.95

Supports all PICmicro MCUs Direct Access to Internal Registers Supports In-Line Assembly Language Interrupts in PicBasic and Assembly Built-In USB, I2C, RS-232 and More Source Level Debugging

See our full range of products, including Books, Accessories, and Components at:

www. melabs. com

FEBRUARY 2005

45

Nuts & Volts

Project

ezVID, you have to wait for it to complete that command before sending another one. The ezVID will send a READY when it has completed the command. If another command is sent before the READY, then the ezVID will throw it out and reset the receiver when it sends the READY.

The ezVID manual states that the time required to complete most commands is a minimum of 663.56 juS and 16.62, mS maximum (except to change background color and clear screen). It has been found that, if the ezVID responded quickly (around the minimum of 663.56 jllS), part of the READY byte will start sending before the BASIC Stamp 2 can start executing a SERIN command, so it couldn’t be used. The obvious solution is to put in a 1 7 mS delay to wait out the maximum time before sending more commands.

This method has a pro and a con; it takes up less space in the BASIC Stamp 2, but takes longer to execute. The PULSIN command works well and keeps the program moving along. The reason it executes more quickly is that you usually do not have to wait the maximum time for the ezVID to start sending the READY response. By the time the PAUSE 1 com- mand is completed and the BASIC Stamp 2 starts the PULSIN command, the ACK from the last byte sent is already done and the serial Tx line from the ezVID is being held high, waiting to send its READY or it just started sending READY.

Since the serial Tx line from the ezVID is going to toggle between high and low while it is sending READY, the PULSIN command is the perfect choice. When READY is sent from the ezVID, the PULSIN times the pulse of the first low state it sees and then returns it in the variable RS_IN. You don’t care about the value in RS_IN, but since the PULSIN command is complete that means the ezVID is sending READY, since a high-to-low and low-to-high transition was seen. This gives a quick response time while adhering to the timing characteristics of the ezVID. Since RSJN is not used, make it a Bit size so space in RAM is not wasted.

Adding a Custom Character

This sample code defines a lower case “e.” The SEROUT command sends 65, which is the code for adding a user-defined character. The next byte is 0, which is the character number assigned to the lower case “e,” which can be from 0-255. The remaining 14 bytes are the bitmap information that makes up the character:

SEROUT 15, 84,1, [65, 0,0, 0,0, 0,24, 60, 102, 66, 126, 126, 64, 96,60,24]

PAUSE 1

PULSIN 14,0, RSJN or

SEROUT 15, 84,1, [65, 0,0, 0,0, 0,24, 60, 102, 66, 126, 126, 64, 96,60,24]

PAUSE 17

Change Background Color

The SEROUT command sends 66, which is the code for change background color along with a color (0-13) 13, in this case, for orange. PAUSE 4300 waits for 4.3 seconds, the time it takes to change the entire background color before the ezVID sends the READY response:

SEROUT 15, 84,1, [66, 13]

PAUSE 4300

Clearing the Screen

The SEROUT command sends 83, which is the code for clear screen along with a color (0-13); here, we use 0 for black. PAUSE 1600 waits for 1.6 seconds, the time it takes to clear the entire screen before the ezVID sends the READY response:

SEROUT 15, 84,1, [83,0]

Stepper Motor Book I PIC® Microcontroller Books

Easy Step'n

For the experimenter.

Determine surplus stepper motor specs using

simple easy to build test equipment.

Design and build microcontroller-based control systems

(flow charts and code examples included).

Design and build stepper motor driver circuits.

Analyze the mechanical characteristics of stepper motor-

driven devices.

The book is full of experiments, circuits and code. $34.95

Table Of Contents And Ordering Information On Web Site

http://www.2tepperstuff.com

ELECTRONICS

P.O. Box 1414, Hayden, ID 83835 Voice (208) 664-41 1 5 Fax (208) 772-8236

We have been selling on the Internet since 1996. We ship the day we receive your order or the next business day.

Same Useful Books

Table Of Contents And Ordering Information On Web Site.

Not Distributed Via Book Sellers

We accept VISA, MC, AM, DS, MO, Check CA residents please add 7.25% CA sales tax See our web sites for s/h rates.

PIC, PICmicro and MPLAB are trademarks of Microchip Technology Inc.

Eacy Microcontrol'n - Beginner $29.95

Programming Techniques

Instruction set, addressing modes, bit manipulation, subroutines, loops, lookup tables, interrupts

Using a text editor, using an assembler, using MPLAB

Timing and counting (timer 0), interfacing, I/O conversion

Microcontrol'n Appc - Intermediate $44.95

Serial communication - PICmicro to peripheral chips

Serial EEPROMS

LCD interface and scanning keypads

D/A and A/D conversion - several methods

Math routines

8-pin PICmicros

Talking to a PICmicro with a PC using a terminal program

Test equipment and data logger experiments

Time'n and Count'n - Intermediate $34.95

16-bit timing and counting applications

Timer 1 , timer 2 and the capture/compare/PWM (CCP) module

Serial Communicationc - Advanced $49.95

Synchronous - bit-bang, on-chip UART, RS-232

Asynchronous - I2C (Philips Semiconductors)

SPI (Motorola), Microwire (National Semiconductor)

Dallas Semiconductor 1-Wire bus

http://www.sq-l.com

46

FEBRUARY 2005

It’s Time to Play!

PAUSE 1600

Drawing a Character

The SEROUT command sends five bytes: COMMAND, CHARACTER, COLOR, XPOS, and YPOS. COMMAND defines whether the ezVID is going to place a built-in or user- defined character: COMMAND=67 for a built-in character and 85 for a user-defined character. CHARACTER tells the ezVID which character to place: 0-62 for built-in characters and 0-255 for user-defined characters. COLOR tells the ezVID

which color to place it in: use 0-13.

XPOS is the X-axis position to place the character in: use 1-188.

YPOS is the Y-axis position to place the character in: use 1-254:

Using PBASIC 2.0 (which is used in Stamp Pong)

IF IN0=0 THEN [insert label you want the program to goto here} or

Using PBASIC 2.5 - IF IN0=0 THEN

[code that uou want executed is inserted here]

ENDIF

The paddle position is read through the command

SEROUT 1 5,84, 1 , [COMMAND,

CHARACTER, COLOR, XPOS, YPOS] PAUSE 1

PULSIN 14,0,RS_IN or

SEROUT 1 5,84, 1 , [COMMAND,

CHARACTER, COLOR, XPOS, YPOS] PAUSE 17

Reset ezVID

The SEROUT command sends 82, the code for resetting the ezVID. Once you send reset, wait for 250 mS for initialization to be complete:

SEROUT 15,84, [82]

PAUSE 250

Drawing a character is the most common thing you will do in all your programs. In Stamp Pong, this is a subroutine. The main code sets up the variables and then the routine is called to communicate with the ezVID. This saves a lot of code space and time.

The game paddle is the user interface. Refer to Figure 1, which shows the paddle interface to the BASIC Stamp 2. The paddle is con- nected to pins P0 and PI. The paddle works very simply. The fire/select button is connected to pin P0. This line is held logic high by a pull-up resistor, Rl. The fire/select button is a momentary SPST normally open push-button connected to ground. When the fire/select button is pressed, the pin will be pulled logic low. To read the fire/select button, you use the following command:

FEBRUARY 2005

Embedded Solutions.

ATMELAVR(

Based Controller

Micro64

I Pin 1 www.micromint.com

Small size- 1.5" x 2.1" x 0.52

Dual powered - operates on +5V or 6.5-20V at 55 mA (typical)

Program and Data Memories

64k or 128k Bytes of In-System Reprogrammable Flash with 10,000 Write/Erase Cycles

2 or 4 K Bytes EEPROM with 1 00,000 Write/Erase Cycles

36K Bytes SRAM

Programming lock for Software Security

Peripheral Features

Optional 2-channel 12-bit ADC 8-channel 10-bit ADC 8 Single-ended Channels 7 Differential Channels 2 Differential Channels with Programmable Gain (lx, 1 0x, 200x) Byte-oriented Two-wire Serial Interface (I2C)

Dual Programmable Serial USARTs 1 TTL

1 RS-232A, RS-422, or RS485 Master/Slave SPI Serial Interface

i Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes i Two Expanded 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode i Two 8-bit PWM Channels 6 PWM Channels with Programmable Resolution from 1 to 16 Bits i Programmable Watchdog Timer with On-chip Oscillator

i 29 Digital I/O that can sink or source 20 mA

Starting at $119

Single Qty

6PWM

Channels

Programmable Lock for Software Security

2 USART

64 or 128k Flash

ATmega64

OR

ATmega128

I2C Bus

4k Bytes SRAM

SPI Bus

2k or 4k EEPROM

Programmable Watchdog Timer

8-Chan. 0-bit ADC

|32k SRAMl

12-Bit ADC 1/

Optional

1 5 V Regulatoi~|

Real-Time Clock Calender Optional

Serial I/O RS-232A, RS422 RS485

12-Bit ADC Optional

+V(8-16VDC

Unregulated)

Data sheets, Online Ordering and a Complete Catalog of Products at...

r

_

www.micromint.comT

Reduce Your Time to Market.

Minimize your time from conception to production by utilizing one of Micromint's market-proven controllers. Whether your concerns are digital or analog, inputs or outputs, Micromint has a product to fit your needs. Order quantities of one to thousands. Custom design and configurations are available.

With over 500,000 controllers in the marketplace, Micromint has been providing innovative, turn-key solutions to the OEM market for 24 years— from design through production, as well as packaging and shipping the final product. Our broad line of embedded controllers and turn-key solutions can turn your imagination into reality.

Micromint

Visit our website @ www.micromint.com to see our complete line of OEM Solutions.

115Timberlachen Circle | Lake Mary, FL 32746 | 800-635-3355 1 407-262-0066 1 Fax 407-262-0069

Circle #77 on the Reader Service Card.

47

Nu¥s&Volts

Project

RCTIME. The potentiometer is connected to the negative side of capacitor Cl. The command RCTIME is used by the BASIC Stamp 2 to record the time it takes for a pin to go from one logic state to another. Refer to the following code:

HIGH 1 PAUSE 1

RCTIME 1,1, PADDLE

The first two commands, HIGH 1 and PAUSE 1, turn pin PI into an output logic-high pin for 1 mS. This discharges the capacitor before executing RCTIME. When RCTIME is executed, pin PI is turned into an input and capacitor Cl will start to charge up through the potentiometer in the paddle. When pin PI turns from a logic high state to a logic low state, the value is stored in the variable “PADDLE.” The combination of the 0.47 juF capacitor and IK ohm potentiometer was chosen so the command would execute quickly; the less time the command waited for the capacitor to charge, the faster the game play could be. They were also chosen so the RCTIME command will return as close to a single byte number (0-255) as possible on the BASIC Stamp 2.

Paddle jitter may occur in your programs. Jitter is caused when the paddle is not being moved, but the RCTIME command returns a different value for each read. For example, you move the paddle to a location where the variable “PADDLE” is equal to 134. If you hold the paddle

Parts List

With the exception of the ezVID and the BASIC Stamp 2, these components can be found at any local electronics store or online distrib- utor.The board in this article was assembled on a RadioShack proto-board in under half an hour. For the +5 V supply, a 78L05 voltage regulator in a TO-220 case sourced from a 9VDC wall wart power supply was used.

I ezVID Serial Video Module (can be purchased from Multilabs

at www.multilabs.net)

I BASIC Stamp 2 (can be purchased from Parallax, Inc., at www.

parallax.com)

I I OK ohm, 1/8 W, 5% resistor I 150 ohm, 1/8 W, 5% resistor I I K ohm, single turn, linear potentiometer I 0.47 pF, 16 V electrolytic capacitor I SPST momentary normal-open push-button I Four-pin female header I 24-pin 0.6” DIP socket I +5 VDC power supply

48

at that point and constant- ly execute the RCTIME command, you will notice that most of the time a value of 134 will be returned, but values of 133 and 135 will also be returned on occasion.

You can reduce this with hardware changes, such as better tolerance components and high precision potentiometers. You can also reduce it with software, such as reading the paddle 10 times and then taking the average value. You can experiment with this in Stamp Fong. Resistor R2 completes the paddle circuit. This is simply protection against short circuits. When the capac- itor is completely charged up, the negative side is at 0 volts. Executing the HIGH 1 command would cause an instantaneous in-rush current to occur during the dis- charge. This resistor is just some insurance to keep the BASIC Stamp 2 from experiencing high in-rush currents.

Gaming Code

The interface and communications stuff is out of the way, so let’s get on to the real stuff. When the game first executes the variables and the initial pin settings are done, the program will wait to make sure enough time has passed for the ezVID to initialize itself, send the command to clear the screen, and then begin loading custom characters. The custom characters are an off light bulb, an on light bulb, a paddle, a selection arrow, a brick piece, and the ball.

The main game code is then executed. The game is broken up into three pieces: the title screen, the paddle color selection screen, and the main game screen. These are shown in Figures 4 through 6, respectively. The title screen is shown first and is also the screen that the game returns to when the game is over. It is simply the name of the game “STAMP FONG” surrounded by a constantly rotating light show. Instructions appear to prompt the game player to press the fire button when ready. This code is a tight loop where the BASIC Stamp 2 is constantly sending commands to the ezVID to place a “light on” character, place a “light off” character in the same position, increment the position, and check to see if the fire/select button on the paddle has been pressed. As long as the fire/select button has not been pressed, the rotating light show will continue to go around the game title.

When the fire/select button is pressed, the title screen is cleared and the paddle color selection screen is drawn. Here, the user can select the color of the paddle in the game. This is the first instance where the code to read the paddle is used.

The value of “PADDLE” is used to determine the position of the arrow. Two conditions are checked; if the value of PADDLE is greater than or less than the selection

FEBRUARY 2005

It's Time to Play!

area, then the value is ignored and the last value is used. When the user presses the fire/select button, the position of the selection arrow is noted and the paddle color is written into the variable “PADDLE_COLOR.”

Once the paddle color has been selected, the screen is cleared and the main game screen is drawn. This version of Pong is made for a single player, so a brick wall is drawn along the top and bottom, as well as along the right side of the screen. The paddle is placed on the left side of the screen and the score is located in the upper left-hand corner. Game play is simple: hit the ball back into the playing field when it comes to you. Every time you hit the ball, the score is incremented by one. For every five points you score, the ball speed is increased by one; the longer you play, the faster it gets. The first time you miss the ball, the game ends and “GAME OVER” appears in the center of the screen. In five seconds, the screen will clear and the title screen re-appears.

Stamp Pong has very simple colli- sion detection; you have to check the walls and the paddle and that’s it. The walls are simple; they don’t move. You know where they are at all times, so their value is constant. Every time you move the ball, you check to see if the new position is beyond one of those constants. If it is, then draw the ball just touching the wall and change its direction. Even the paddle is pretty simple. The X position never changes and you know the Y position from your paddle read that is stored in the “PADDLE” variable. Treat the paddle just like a wall. If the new ball position is going to cross the X boundary of the paddle, then check the Y position. If the ball hit the paddle, redraw the ball just touching the paddle and change its direction. If it didn’t hit the paddle, then the game is over.

When changing the direction of the ball, you just have to know its last direction and what it hit. If the ball is traveling up and it hit the top wall, then change its traveling direction to down. However, if a ball is traveling up and it hits the back wall, you don’t

change its Y-axis direction, but rather its X-axis direction which is left and right. Since the ball hit the back wall, if it was traveling right, you would change its direction to left.

There is one last conditional that you need to check: the paddle position. As mentioned before, the RCTIME command will return a value of approximately 0 to 255 for the com- plete travel of the potentiometer in the user paddle. The paddle on the screen just like the ball has to be confined within the walls. Each time RCTIME is read, the Y position is checked to see if the new position will be outside one of the walls. If it is, then the new value is thrown out and the previous paddle position is used instead.

Conclusion

A lot has been done since the ezVID was created and Stamp Pong was made to try it out. New games

and drawing programs have been made and they get better all the time. Every time a program is made, new possibilities are thought up and more is learned.

Well, that’s all for now. You’ve been presented with the basics of hardware and software for gaming and graphics with the ezVID and the BASIC Stamp 2. The rest of it is up to you. Remember: Be creative. Optimize your code so you can do more with less. Keep in mind the limitations of your hardware, but don’t let this limit your imagination. Get a clear picture of what you are going to do first and how best to achieve it by looking at all your possibilities. If you’re going to make a game, get all the rules together first so you can code them in. Most important of all have fun!

In front of me is a BASIC Stamp 2 and an ezVID, but in my mind, I’m back programming games on my old computer ... NV

ATOMIC TIME

ioio Jorie Blvd. #332 Oak Brook, II 60523

1-800-985-8463

www. atomictime . com

m

Office School Clock #1 LT WT-3121A $39.95>

This wall clock is great for an office, school, or home. It has a professional look, along with professional reliabil- ity. Features a manual set option, day- light saving time disable option, and a safe plastic lens and case.

Atomic Digital Wristwatch n< H15U $34.95

A high tech digital wristwatch with a sophisticated look. Features a metal t-d ‘stretch’ band and a high-contrast digital display. 12/24 hr time formats. Tjacklight, date, and day of week.

Arcron Atomic Watch <56G24-4 $249.99 |

This elegant watch features a shock- resistant titanium case with hardened mineral lens. Silver dial with arabic numerals, and high quality replace- able leather band. Watch can change to any world time zone. Case diameter I 40mm. Made in Germany.

1-800-985-8463

www.atomictime.com

WT-3121A

WS-8007U-C

ALaCrosse Digital Wall Clock $34.95 I This digital wall / desk clock comes with a beauti- ful cherry wood frame. It shows time, date, day of week, temperature and moon phase. 12/24 format.

Tell time by the U.S. Atomic Clock -The official U.S. time that governs ship movements, radio stations, space flights, and war- planes. With small radio receivers hidden inside our timepieces, they automatically syncronize to the U.S. Atomic Clock (which measures each second of time as 9,192,631,770 vibrations of a cesium 133 atom in a vacuum) and give time which is accurate to approx. 1 second every million years. Our timepieces even account automatically for daylight saving time, leap years, and leap seconds. $7.95 Shipping & Handling via UPS. (Rush available at additional cost) Call M-F 9-5 CST for our free catalog.

Circle #82 on the Reader Service Card.

49

FEBRUARY 2005

New Product News

NEW 1,000 A AND 800 A CLAMP METER SERIES

Extech Instruments

announced its new series of 1,000 A and 800 A clamp meters. Each 1,000 A clamp features a unique, built-in, non- contact Infrared thermome- ter with a laser pointer to monitor temperature and locate hot spots on motors and electrical devices. Each 1,000 A meter features min/max, a data hold feature that "freezes" the data in the display, and an auto ranging feature with a manual range override.

Both series feature a large, 4,000-count LCD display with bright backlighting that allows the user to see the reading in dim light. The ergonomically designed double-molded housing offers a better grip for performing one-handed operations. All meters measure resistance, capacitance, frequency, and continuity. In addition, they offer a fast peak hold that captures inrush currents and transients.

Each meter in the 1,000 A series measures AC/DC voltage and AC current, while the EX830 also measures DC current. The 1,000 A meters have a 1.7” (43 mm) diameter jaw opening large enough for conductors up to 750 MCM - and both the EX820 and EX830 are True RMS models.

Each meter in the 800 A series measures AC/DC voltage and AC current, while the EX730 also measures DC current. The 800 A meters have a 1.2" (30 mm)

diameter jaw opening for conductors up to 500 MCM; both the EX720 and EX730 are True RMS models.

All clamps feature auto power-off and come complete with test leads, a 9 V battery, and a belt holster. The True RMS meters also come with a Type K bead wire probe for temperature measurements.

For more information, contact:

EXTECH INSTRUMENTS Tel: 203-366-7186 Email: info@extech.com Web: www.extech.com

Circle #1 14 on the Reader Service Card.

MULTI-PORT SERIAL-TO- ETHERNET APPLICATION KIT

Rabbit Semiconductor has introduced the Multi-Fort Serial-to-Ethernet Kit. Rabbit Application Kits enable embedded designers to quickly implement common application needs without designing from scratch. The Multi-Port Serial-to-Ethernet Kit allows multiple ports to convert data from serial to ethernet. In addition, this new kit allows bi-directional conversion from serial-to-ether- net and ethernet-to-serial.

Serial-to-ethernet conversion is necessary for data to be remotely monitored via most networks or the Internet. The Rabbit Multi-Port Serial-to-Ethernet Kit provides the hardware and software necessary for sensors and other serial devices to communicate via a LAN or other network. Implementation of the optional RabbitWeb software module makes it simple to web-enable applications to allow monitoring and control of serial devices via the Internet or Intranet. Other optional software modules help secure data through SSL and encryption.

The Rabbit Serial-to-Ethernet Kit uses a temperature sensor application to guide users through serial-to- ethernet conversion. Based on the RCM3700 RabbitCore, the kit also includes a prototyping board, the Dynamic C development environment with a royalty-free TCP/IP stack and source code, sample applications, a temperature sensor for the sample application, required cables, and assorted accessories. The sample applications highlight functionality, such as RS-232 to ethernet conversion, RS-485 to ethernet conversion, ethernet-to-serial conversion, data gathering from serial devices such as the included temperature sensor or

Are You Scope Certified Yet?

%/%

s

£

Operate Basic Scope Controls

Set Trigger Level

Read the Graticule

Take Accurate Measurements

Analyze Waveforms

Select the Correct Probe . . . And More!

Our 1-Hour Video and Tech Manual Will Get You Up To Speed Quickly.

Includes Certification Exam from SYSPEC!

VHS tape & Tech Manual Just $69.95 + $5 SIH (US addresses) NYS residents add sales tax ...

More! Send Check or M.O. to:

^ SYSPEC INC

www.syspec. com ) po Box 2546

1-877-SYSPEC1 ) Syracuse A/y

50

FEBRUARY 2005

New Product News

digital voltmeter (which is not included), and web-enabling applications.

For more information, contact:

RABBIT SEMICONDUCTOR

2900 Spafford St.

Davis, CA 956 1 6 Tel: 530-757-8400

Email: rabbit@rabbitsemiconductor.com Web: www.rabbitsemiconductor.com

Circle #13 1 on the Reader Service Card.

FREESCALE ZIGBEE™ WIRELESS TECHNOLOGY

MaxStream, Inc., has adopted the Freescale Semiconductor, Inc., platform for an assortment of ZigBee™ wireless products. MaxStream will shortly intro- duce the Federal Communications Commission and CE-type approved XBee™ family, which incorporates Freescale’s ZigBee-ready and 802.15.4 chipsets onto MaxStream’s RF modules. The XBee line of RF modules and stand-alone connectivity solutions will allow OEMs to add wireless capabilities to their products easily and quickly. The ZigBee wireless standard is a cost-effective solution for con- necting electronic devices in a short range wireless mesh network.

MaxStream will offer two versions of the XBee ZigBee module, allowing OEMs the choice between either low cost or high performance modules. The low cost XBee module measures less than one square inch, while the 100 mW high performance XBee-PRO™ module is only two-thirds of an inch larger and achieves up to three times the range of standard ZigBee modules. Both module designs are network and form-factor interchangeable, allowing the modules to be easily upgraded or reconfigured to meet the changing needs of each ZigBee network. RS- 232, USB, and ethernet interfaces will also be available in 2005, creating simple connectivity solutions to computers and other electronic devices.

Additional ZigBee-based

products including a wireless bridge that permits ZigBee networks to connect to long-range MaxStream radios will be made available to complement the capabilities of both

FEBRUARY 2005

ZigBee and MaxStream proprietary networks.

Freescale’s ZigBee-enabled platform includes the MCI 31 93 2.4 GHz RF chip, a low voltage, low power HCS08 MCU, and the Z-Stack ZigBee software for a robust, cost- effective, and easy-to-deploy solution. The MCI 31 93 on-chip features and enhancements reduce external components and total bill of materials cost while providing battery type flexibility with lifetimes of up to several years.

The XBee module operates in the 2.4 GHz ISM bandwidth and will come with the necessary software to create ad-hoc ZigBee networks. The modules are designed to transmit at power-efficient levels and power-down sleep modes help conserve additional energy when data transmission is intermittent.

MaxStream offers unlimited free technical support for all of its wireless technology via telephone, Email, and online chat, making it easy for customers to integrate ZigBee technology into each specific design.

For more information, contact:

MAXSTREAM, INC.

Tel 866-765-9885 Email: info@maxstiream.net Web: www.maxstiream.net

Circle #127 on the Reader Service Card.

Learn the basics

of programming and networking

imaginetools.com

limited .. ____

time offer tj*

Learn by doing!

The ImagineTools™ Ethernet Starter Kit gives you all the tools to begin your development.

Ethernet Starter Kit

C-Programmable 8-bit Rabbit 3000® Microprocessor

Think

Learn

core module with Ethernet, experimentation board, and Dynamic C Lite with compiler, editor, and debugger.

Build

i

imagine tools

Circle #107 on the Reader Service Card.

51

CLASSIFIEDS

CLASSIFIED ADVERTISING

$50.00 Per Inch No extra charge for color (Limited time offer).

Classified ads must be paid in full prior to the closing date. Visa/MC/Amex accepted. Payment for ads received after the closing date will cause the ad to be placed in the following issue, at our discretion. Minimum charge is one inch with half-inch increments.

No proofs will be sent. Ads to be typeset by Nuts & Volts must be received by the closing date. Supplied ads must be received by the artwork due date.

Call the office at 951-371-8497 or Email classads@nutsvolts.com for closing dates, available sizes, and special prepay discount offers.

Components

RF PARTS' CO.

From Milliwatts to Kilowatts sm

Tubes, Transistors, Power Components.

Email: rfp@rfparts.com Web: www.rfparts.com

800-737-2787 Fax 888-744-1 943

Miscellaneous Electronics For Sale

MAKE SUPER STRONG 3D PARTS FAST

SHAPELOCK PLASTIC™

RAPIDLY CREATE PROTOTYPES, PARTS, SCULPTURES, BRACKETS, HOUSINGS, MOLDS AMAZING PLASTIC MELTS IN HOT WATER, LOCKS RIGIDLY AT ROOM TEMPERATURE INCREDIBLY TOUGH, LIGHTWEIGHT, MACHINEABLE, PAINTABLE, INEXPENSIVE SHAPE BY HAND AND RESHAPE REPEATEDLY WWW SHAPELOCK COM

Floating Point Coprocessor

I2C to 400 kHz SPI to 4 MHz 32-bit IEEE 754 32-bit integer Math functions User defined functions 8-pin DIP or SMT www.micromegacorp.com

I uM-FPUl

'’New" .Version

Ilf

2SCI969 2SC2879 SDI446 2SC2290

See our website for other products

www.westgateparts.com Westgate 1-800-213-4563

FREE I 20 Pg CATALOG

Electronic components, kits, test equipment, tools, and supplies for hams, hobbyists, and businesses. Many hard-to- find items like variable capacitors, vernier dials, coil forms, magnet wire, and toroids.

Ocean State Electronics www.oselectronics.com

m

h

Scientific

Organizations

s

wssm

iM

ONLINE

6

electronics forums!

z

www.nutsvolts.com

52

CStamp™

ADC PWM -at

lr>t \o*°> float

Small format computers in 'C'

www.cstamp.com

Robotics

ROBOTIC

CONTROLLERS

Robot Bases. PIC, OOPic, Stamp and servo controllers. New Walking Machine Controller. Chips, kits, assembled.

www.oricomtech.com

park Fun

Specializing In:

Serial LCD’s and Accelerometers PIC, AVR, MSP, and LPC products Development tools for hobbyists and professionals.

Spark Fun electronics is the largest omec dealer in North America.

WWW C parkFun .com

Computer Hardware Wanted

DEC EQUIPMENT WANTED!!!

Digital Equipment Corp. and compatibles.

Buy - Sell - Trade

Call Keyways 937-847-2300 or email buyer@keyways.com

Poor AM Radio Reception?

This is the Solution!

Select- A-Tenna

For more than 34 this

technically elegant but, simple-to-use device has significantly improved weak AM radio reception. The signal gain is as great as thirty times! And, no hook-up to your radio is required. Simply place it next to your radio and tune. It is already working! No batteries, no wires. It is powerful and really works. You’ll be amazed!

Model 541 $59.95 plus shipping

Satisfaction Guaranteed

Other models are available, see the complete story at our web-site

Intensitronics Corp PO Box 28 Ashland, Wl 54806 800-382-4155 Toll-Free 715-685-0474 Fax www.selectatenna.com Made in the USA

Microcontrollers

MicroStampll

World’s Smallest 68HC11 Microcontroller Module!

telemetry

microrobotics

smart toys

animatronics

model railroading

home automation

tiny (1 by 1.4 in.), light-weight (0.5 oz.)

on-board 5V reg., crystal, & reset chip

choice of 8K or 32K EEPROM

or 32K RAM + 32K EEPROM (64K version)

SCI, SPI, Output Compare and Input Capture channels, timer, pulse accumulator

all 14 I/O lines and 2 interrupt lines brought out to versatile 20-pin connector

program in BASIC, assembler, or C

easy code-loading with Docking Module

Starter Packages:*

8K EEPROM (#MS11SP8K) $49

32K EEPROM (#MS11SP32K)...$77

32K EE/32K RAM (MS11SP64K)$90

* includes MicroStampll, manual, PC soft- ware (assemblers, SB ASIC compiler, MicroLoad utility, and sample programs), serial cable, Docking Module, & accessories.

www.technologicalarts.com

Toll-free (USA & Canada): 1-877-963-8996

Visa MasterCard Discover Amex

OVER 4,300 ITEMS IN STOCK

Surplus & Refurbished Electronic Equipment Parts & Accessories

Audio, Communication, Computer, Telephone, & Video Equipment. Repair Parts & Service Manuals.

SMC ELECTRONICS www.smcelectronics.com

On Sale Now

Cordless Telephone Battery Packs 50 - 75% OFF RETAIL PRICES!

Batteries/ Battery Chargers

Smart Battery Charger

FOR GEL- CELLS or LEAD ACID BATTERIES

New & Improved

Features: Precision temperature tracking voltage reference & three mode charging sequence.

Standard kit is for 12V @ 1/2 or 1 Amp. user selectable. Can be connected to the battery indefinately, will not over-charge. Weighs 2 pounds and measures 4” W x 5V2” D x 2V2” H. Finished enclosure included in kit.

Complete Kit (#1 50-KIT) $59.95

Assembled & Tested (#150-ASY) $79.95

CA Residents add 7.75% sales tax. S&H: $7.50 (insured) Foreign orders add 20%

www.a-aengineering.com

® A&A Engineering m

2521 W. La Palma #K Anaheim, CA 92801 (714) 952-2114 FAX: (714) 952-3280

Computer Software

FEBRUARY 2005

CLASSIFIEDS

Connectors Wire/ Cable

I (

Audio/Video

The RF Connection

213 N. Frederick Ave.,Ste. I INV Gaithersburg, MD USA 20877

http://www.therfc.com/

Complete Selection of MIL-Spec Coax , RF Connectors and Relays

UG-2 1 B/U N Male for RG-2 13/214 .$5.00 UG-2 1 D/U N Male for RG-2 13/214 .$3.25 N Connectors for 99 1 3/Flexi4XLV9096

UG-2 1 B/99 I 3 $6.00 / Pins Only. $ 1 .50

UG-2 1 D/99 I 3 ..$4.00 / Extra Gasket.$0.75 Amphenol 83- ISP- 1 050 PL-259 $0.90 UG- 1 76/U Reducer RG-59/8X, $0.25 or 5/$ 1 .00

UG- 1 75/U Reducer RG-58/58A, $0.25 or 5/$ 1 .00

SilverTeflon PL-259/Gold Pin, $1.00 or 1 0/$9.00

MIL-Spec Coax Available (Teflon, PVC IIA) New Product: Belden 99 1 3F, 99 1 3 with High Density PE Foam dielectric, stranded center cond. and Duobond III Jacket $0.80/ft or $76.00/1 00ft Also New: 9092, RG8X with Type II Jacket.

Intro Price $23.00/ 1 00ft

Call for Specials of the Month Full Line of Audio Connectors for Icom, Kenwood, and Yaesu 8 Pin Mike Female $2.50

8 Pin Mike Male Panel $2.50

I 3 Pin DIN for Kenwood $2.75 8 Pin DIN for Icom $1.00

8 Pin DIN for Kenwood $ 1 .50 Prices Do Not Include Shipping Orders 800-783-2666

Info 301-840-5477

FAX 301-869-3680

CCD/Cameras/

Video

USB 2.0 Camera module with SDK Mega pixel high-speed USB2.0 camera module. Capture size from 320x240 to 1280x1024 at real time speed. Complete SDK, highly customizable and flexible. On board hardware resources. Price from $89 to $169. Suitable for all kinds of computerized image capturing project.

For more information, visit our website

www.fclab.com

Computer

Hardware

Program in C!

measurement & control

robotics

on-board sensors

on-board user I/O

expansion headers

demo program preloaded •full hardware + software •$125

www.garage-technologies.com

SCSI

I-U320 50Pin-68Pin-80Pin 1 to 8 Bay Case Enclosures Adapters Cables Terminators Low Prices - Qty Discounts! (Also FireWire, USB, Video) www.mcpb.com

Mfg. Custom Data/Computer Cables Network, Coaxial, Fiber Optics Wholesale & Retail

R & D Electronic Supply

714-979-1834

3301 S. Harbor #108, Santa Ana, CA

Visit us at www.rdelectronic.com

ftarddo-find Printer Ri66ohs

INKJET REFILLS INKJET CARTRIDGES AT DISCOUNT PRICES

Write for price list or check out our web page.

H.T. Orr - Computer Supplies 249 Juanita Way Placentia, CA 92870-2216

TOLL FREE 1-800-377-2023 LOCAL 714-528-9822 FAX 714-993-6216 £

email: Htorr@aol.com http://users.adelphia.net/~htorr

Plans/Kits/

Schematics

Kit contains bridge rectifier, all i caps, and LM78L05 regulator $9.95 ea. postpaid.

JOSEPH FINN,

Measures 1

www.matco.com

VGA to Video Converter ULT-2000

Use big video screen as PC monitor Capture PC images on video recorder $85/ea - 24bit, 16.7 mil colors

www.matco.com

2 Input Digital Video Web Server

DVR-1 000-WS allows up to 2 composite video sources for broadcast on the Internet, 10/100 Base-T network interface, Accessible via Internet or LAN, Fixed or Dynamic IP address, Auto e-mail warning or image FTP when alarm trigged, 15 fps, Built-in Auto Network Reconnection function, IE Browser display (800)719-9605 sales@matco.com

Video to VGA Converter VGA-802

$69/ea

- Display Composite Video or S-Video sigal on PC monitor

- Works w / or w/out PC

- Stereo Audio amp.

- 24bit, 16.7 mil colors

- Powered by 5 VDC

(800)719-9605 sales@matco.com

www.matco.com

Pocket Digital Video Recorder

- - Built-in HDD for 40hrs real-

time recording in MP4

- Wired button & IR Remote Control

- A/V in/out, USB interface

- 3.5" TFT LCD monitor

- 5-1/8" x 3-3/8” x 13/8”

- Weight 0.67 Lb.

(800)719-9605 sales@matco.com

Design/Engineering Services

ONE PAS, INC.

The Future of

Prototyping

www.onepasinc.com

Your Idea

on a budget

Product Development Electrical Design Firmware Far East Manufacturing Prototyping

www.elementinc.com 303-466-2750

* Circuit board lai|outs ^Protctqpe assemblies

WWW.OSPREYELECTRONICS.COM

Convert your sketch or print into a quality peb for a reasonable price. Visit us on the web or call Osprey Electronics at (208) 665 1688 (USA)

Membrane Keyboards/ Switches

CUSTOM M€MBRRN€ K6VBORRDS / SLUITCH6S

1 TO 2 WEEKS TURNAROUND ►VERY COMPETITIVE PRICING

Ex.: (5) 4-switch keyboards for $395.00

Custom metal bookplates, cases and assemblies

Electronic assemblies/graphic overlays

Picofab ln«.

Tel: (418) 622-5298

Toll free: 1-888-408-4780 Email: sales@picofab.net

FEBRUARY 2005

CLASSIFIEDS

Security

IP Solution

www.matco.com

4 Channel Network DVR

DVR-2200-W $499/ea

30 fps full size/120 fps quad size; Up to 250 GB optional HDD; Dynamic or statistic IP; Internet accessable; Wavelet compression format; Alarm input/output; Video loss detection; Multiple quick search; POP/PIP; RS-232, RS-485 comm. (800)719-9605 sales@matco.com

Buy DirecUow Prices

Spy Cameras, Underwater Cameras Vehicle Tracking, Telephone Recorders Phone Bug Detectors

consumertronics.net

Hi-Tech Survival Offers!

Electronics, security, energy, computers, Net, phones, medical, legal, financial, weird. Cat.$1

www.matco.com

Real Time 4 Channel PC Based Digital Video Capture Card

Internet Accessable Real Time DVRC-TD4

[ 30/30 fps, 320 x 240, Local & f Remote PTZ control, 4 BNC Video Input, S/W included Plug and Play (800)719-9605 sales@matco.com

$69/ea

CLASSIflED ADS WORK!

Oa// Us Today to "Place ybur /W

951-371'%497

Card-Access

Magstripe

i

>

A

Low-cost access Ctrl.

Expandable system

Door/gate relay control

Windows host software

USB & RS-485 comm.

Controllers from $69

Systems under $400

Reseller discounts

Smart-' |\ Cara j

www.kadtronix.com

www.matco.com

18 Ch 12 VDC Power Distribution Box

$99/ea 12 VDC regulated, Total

current 6A, 18 outputs, 333 mA per terminal, 18 terminal blocks, Fuse on each channel, 18 female power connectors on PCB board for easy connect to camera cable.16"WX9.5"HX3.5"D (800)719-9605 sales@matco.com

XF*250DC-6A/18

ZAP CHECKER MODEL 270

WIRELESS INSTALLATION METER

for WIFI, WLANs & SURVEILLANCE

Aims and Aligns Antennas

Tests Transmitter/Antenna Output

Measures Baseline RF and RFI

Identifies HOT and COLD spots

Finds Hacker Sites & Cable Leaks

Optimizes Hub Placement

*3 00 w/ directional 1.8 -45 GHz Ant.

>DZ.y (t- $7 S4H.CA Residents add 8J5% tax)

ALAN BROADBAND CO.

93 ARCH ST, REDWOOD CITY, CA 94062 TEL (650) 369-9627 FAX: (650) 369-3788

WWW.ZAPCHECKER.COM

PROFESSIONAL EAVESDROPPING DETECTOR

2.4 GHz BUGS detected at 100 + feet

$549

DETERMINES DIRECTION SUPER FAR-FIELD DETECTION HOMES-INi PINPOINTS LOCATION 1 0 MHz - 4.5 GHz BANDWIDTH, - 70 dBm at 2.4 GHz

ALAN BROADBAND CO.

(650)369-9627 (888)369-9627 FAX: (650) 369.3788

WWW.ZAPCHECKER.COM

News Bytes

What Was That Password!

(A

£

How many times have you forgotten your password for logging on to a site that you frequent, making an online bank payment, or simply connecting to your network? We have become totally paranoid about using passwords. We are constantly warned not to use phone numbers, addresses, family members’ names, or anything that a good hacker might be able to figure out. So what do we do? We make up weird passwords that we can never remember. Some even go so far as to use a password manager that also requires a password for access. You guessed it! They end up writing that password on a sticky- note so they wouldn’t forget that, either. There was no way to simplify the storing or recall of passwords ... until now!

AFC the company we all know for their UPS systems and surge protectors has a Biometric Password Manager that uses your own finger impression on a tiny USB-connected device, allowing you access to all your stuff. Not only does it allow you access, but you can add up to 20 other users, each of which remains secure until they place their finger on the pad. Called the BioPod, it comes complete with a 6’ USB cable and installation is a snap. Software provided is compatible with Windows

54

98, Windows ME, Windows 2000, and Windows XP.

Of all the gadgets available to add to a computer, this one could prove to be the most valuable to date. The BioPod is being offered by Tritronics Incorporated, a supplier of consumer electronics replacement parts. Visit their website at www.tritronicsinc.com

An Engineer’s Engine

It seems there’s a search engine for everyone. Academics have Teoma, shoppers have Buyer’s Index, and people who like wading through pages of irrelevant results have Msn. Now, the Internet has decided to cater to engineers. The Engineering Web from GlobalSpec offers search results that are touted as more relevant to technical work. They offer parametric searching of over 75 million part specs, as well as application notes, material properties, standards, and patents. It even claims to block pop-ups! Over 70% of users are engineers, with purchasing and research personnel comprising the majority of the remainder. Use of the service has doubled in the last two years and the B-to-B behind the service boasts access to information that is normally hidden on the web due to firewalls or required registration or fees.

To download the Engineering Toolbar, go to www.globalspec.com/Engineering-Toolbar/ install At present, you’ll need MS Windows 98, Me, NT, 2000, or XP and Internet Explorer 5.0 or newer.

FEBRUARY 2005

CALL TOLL-FREE

(800) 292-771 1 Orders Only

Se Habla Espanol

C&S SALES

Secure On-line Ordering @ cs-sales.com

FREE GIFT with online purchase (use coupon code NV)

CALL OR WRITE FOR OUR

FREE

64 PAGE CATALOG! (800) 445-3201

Elenco Digital Multimeters

Elenco Snap Circuits'1

Model M-1750

11 Functions:

Freq. to 20MHz

Cap. to 20pF

AC/DC Voltage

AC/DC Current

Beeper

Diode Test

Transistor Test

Meets UL-1244 safety specs.

Model LCM-1950

Large 1” 3 3/4 Digit LCD

Autoranging Freq. to 4MHz Cap. to 400pF Inductance to 40H Res. to 4.000MQ Logic Test Diode & Transistor Test

Audible Continuity

Model M-2795

$/l/l 95

AC/DC voltage

Current (10A max.)

Test Equipment

Elenco’s new Snap Circuits™ make learning electronics fun and easy. Just follow the colorful pictures in our manual and build exciting projects, such as: FM radios, digital voice recorders, AM radios, burglar alarms, doorbells, and much more! You can even play electronic games with your friends. All parts are mounted on plastic modules and snap together with ease. Enjoy hours of educational fun while learning about electronics. No tools required. Uses “AA” batteries.

6 versions available.

Build up to 750 projects!

As low as $29.95

F-2850 E,enco Handheld Frequency Counters 10Hz -3GHz Models F-2800 & F-2850

10 digit display 16-segment RSSI bargraph Resolution to 0.1Hz (F-2850)

Resolution to 1 Hz (F-2800)

Selectable gatetime (F-2850)

Hi-speed (300MHz) direct count

Includes NiCd charger and antenna

F-2800 $99

F-2850 $185

Create Your Own Exciting Experiments

Elenco Quad Power Supply Model XP-581

4 Fully Regulated Power Supplies in 1 Unit

r

'Of

-j*

75

4 DC Voltages: 3 fixed; + 5V @ 3A, +12V @ 1A,

1 variable; 2.5 - 20V @ 2A Fully regulated & short protected Voltage & current meters All metal case

Elenco Oscilloscopes

Free Dust Cover and xl, x2 Probes

2 year warranty

I *299

'"34325 25MHZ

S-1330 25MHz Delayed Sweep S-1340 40MHz Dual Trace S-1345 40MHz Delayed Sweep S-1360 60MHz Delayed Sweep S-1390 100MHz Delayed Sweep

Elenco RF Tracer 1MHz - 3GHz

*195

Pocket-size, easy-to-us » Speaker/earphone/vibrate alerts > 5-segment RSSI bargraph

» Low power consumption

Includes NiCd, charger, and antenna

Tells you if your room is bugged.

Models Available

SC-750 - Extreme Version, contains over 80 parts to build over 750 experiments. Includes everything from SC-500

plus experiments in solar, electromagnetism, vibration switches, and 70 computer interfaced experiments... $119.95

SC-500 - Pro Version, contains over 75 parts including voice recording 1C, FM radio module, analog meter, transformer,

relay, and 7-segment LED display. Build over 500 experiments

SC-300S - Deluxe Version, contains over 60 parts. Build over 300 experiments plus 20 bonus

computer interfaced experiments $74.95

SC-300 - Standard Version, same as SC-300S, but without bonus experiments $59.95

SC-100 - Snap Circuits, Jr., contains over 30 parts. Build over 100 experiments

..$89.95

..$29.95

Elenco 5MHz Sweep Function Generator w / built-in 60MHz Frequency Counter Model GF-8056

4*9 9 « 9 j

$225

Generates square, triangle, and sine waveforms, and TTL, CMOS pulse.

GF-8046 - 3MHz w/ counter $199 GF-8025 - without counter $99.95

iBOTZ Hydrazoid Kit Model MR-1004

Walks and makes sounds

$29.95

non-soldering

Elenco Educational Kits

Model 21-880

Line Tracking Mouse Kit

$25.95

Model RCC-7K

Radio Control Car Kit

7 Functions $27

AK-870

(non-soldering)’

$27.95

Model AM-780K

Two 1C Radio Kit

>:

$g 9!

Model M-1006K

DMM Kit

18 Ranges

3 1/2 Digit LCD

Transistor Test

Diode Test

*1 8.95

LJ

Model AK-700

Pulse/Tone Telephone Kit /Flashing Neon Lights n Great School Project

95

$14,

Model K4001

t 7W Amplifier

$12 9i

Deluxe Soldering Irons

Electronic Science Lab

$

Elenco 4-Functions-in-1 Instrument

Model MX-9300B

495

Ideal for labs, production lines, R&D and hobbyists!

Sweep Function Generator

0.2Hz to 2MHz

Sine, square, triangle, skewed sine, ramp, pulse, TTL level square

VCF voltage 0 to 10VDC

Digital Triple Power Supply

* Output #1

* Output #2

* Output #3

0-30VDC, up to 2A 5VDC, up to 2A 15VDC, up to 1 A

Digital Multimeter

400mV - 400V AC/DC

20A max. AC/DC current

Resistance to 40MQ

Frequency Counter

1Hz to 2.7GHz

7-digit display

Selectable time base

Weller® Low Cost Soldering Iron

Model WLC100

Variable power control produces 5-40 watts.

Ideal for hobbyists, DIYers and students.

Complete with 40W iron.

Maxitronix 500-in-1 Electronic Project Lab

Model MX-909

Everything you need to build 500 exciting projects!

Learn the basics of electronics. 500 different electronic experiments, special | lighting effects, radio transmitter and I receivers, sound effects, cool games and I MORE

Includes built-in breadboard and an LCD.

Explore amplifiers, analog and digital circuits plus how to read schematic diagrams.

Includes 1 1 parts.

Lab-style manual included.

Requires 6 “AA” batteries.

MX-908 - 300-in-1 Lab $69.95 MX-907 - 200-in-1 Lab $49.95 MX-906- 130-in- 1 Lab $39.95 $

EP-50 - 50-in-1 Lab $18.95

175

Guaranteed Lowest Prices

UPS SHIPPING: 48 STATES 7% (Minimum $7.00) OTHERS CALL FOR DETAILS IL Residents add 8.5% Sales Tax

SEE US ON THE WEB

C&S SALES, INC.

150 W. CARPENTER AVENUE WHEELING, IL 60090 FAX: (847) 541-9904 (847) 541-0710

http://www.cs-sales.com

15 DAY MONEY BACK GUARANTEE ”1 2 YEAR FACTORY WARRANTY

PRICES SUBJECT TO CHANGE WITHOUT NOTICE

FEBRUARY 2005

Circle #80 on the Reader Service Card.

55

Why Use Interrupts ?

Interrupts are very powerful tools built into almost every microcon- troller. If you write microcontroller code, I can guarantee that they Will f make your life easier. Once you learn the basics of interrupts, you will find that they work essentially the same on all microcontrollers.

If you’re planning on counting instructions or adding NOPs to your code to get precise timing, you’ll need to learn about interrupts. You’ll find that they not only make it easier to write your code the first time, but when you have to change the timing of your project they will | really save you time and headaches. Instead of recounting all thoSd / 7, <1 instructions, you can just change the interrupt timing by changing a single constant.

If you need to do anything in real time like controlling a motor or generating and reading communication signals, such as serial streams interrupts are the way to go. With an interrupt, you will be assured that the timing of your signals will be right. Without consistent timing, you can get jerking in your motors and hard-to-diagnose errors in your communication routines,

Once you’ve become familiar with using interrupts, they will become like the heartbeat of your code, the regular rhythm at the core of your project. You’ll find that they aren’t intimidating and you’ll wonder how you ever wrote microcontroller code without them. You will start designing your project around the interrupt and find that this simplifies the design and makes development faster.

CONFIDENTLY USING INTERRUPTS IN YOUR MICROCONTROLLER PROJECT

What Is an Interrupt

If you don’t use interrupts, I hope that I’ve motivated you to learn more about them. Let’s start by defining an inter- rupt. Although there are many different types of interrupts, in this article I will only discuss periodic timer-generated interrupts because I’ve found them to be the most useful; they are also available on almost any microcontroller. Once you’ve learned about timer interrupts, though, it will be easy to extend the basic concepts to other types of interrupts.

In the case of a timer-generated interrupt, the interrupt is an event in the microcontroller that lets you run a short section of your code at a regular interval. For instance, you might set up an interrupt to run at 1 kHz or 1 ,000 times per second. In this case, every one thousandth of a second, you will get an interrupt. Like the ticking of a sped-up clock, the interrupts occur on a set schedule and they occur no matter what else is going on in the main body of your microcontroller code.

Each time the interrupt occurs, the microcontroller will run a certain section of the code you’ve loaded into its memory. The code it runs is often referred to as the interrupt service routine (ISR). This is where you do the work of your interrupt. For instance, imagine you are designing a digital clock with a microcontroller and had set it up to have a 100 Hz interrupt. In the ISR code, which would run 100 times each second, you would have a counter that counted up to 100. During each interrupt, you would increment a counter variable and then check to see if that counter had reached 100. If it was 100, you would set it back to 0 and increment the seconds counter on your clock. So, the seconds digit on your clock would increment once every 100 interrupts exactly once a second. This is a very basic use for an interrupt.

To explore a more complex example, suppose you want to control a motor with a signal generated on one of your microcontroller’s pins. To control the motor’s speed, you could generate a pulse width modulation (PWM) signal using an interrupt. In this case, you would set the interrupt frequency to be equal to the PWM signal frequency, multiplied by the PWM resolution. Then, in each interrupt, your code would decide whether to set the pin high or low to generate the correct PWM duty cycle. I’ll go into this example in more detail below and in the sidebar.

In most applications, you will probably do more than one thing in each interrupt. If your application is a mobile robot, you might generate a PWM signal for each wheel motor, read a few sensor signals, and also keep a timer to control behaviors all in the same interrupt service routine.

How an Interrupt Works

Microcontrollers have special hardware built into them to generate and handle interrupts. In the case of a timer- generated interrupt, the microcontroller generates an interrupt whenever a specific timer rolls over. Almost all microcontrollers have timers; timers are built-in register

Voltage

ill

Interrupt

Period

n i

n n n

Time

FIGURE 1. An oscilloscope trace of a typical interrupt.

variables that are incremented every instruction cycle. Counting the instruction cycles is the same thing as counting the time. Certain instructions take more than one instruc- tion cycle to run, but the instruction cycle time is constant. When a timer reaches its maximum value (255 for an eight-bit timer), it rolls over to a value of 0. If your timer interrupt is enabled, this rollover will generate an interrupt.

For eight-bit microcontrollers, timers that can generate interrupts are usually eight bits or 16 bits, sometimes with prescalers to extend their ranges. A prescaler allows you to get slower interrupt rates with an eight-bit timer, though with less precision. For instance, a prescaler value of 4 tells the microcontroller to increment the timer every fourth instruction cycle instead of every cycle, so that your interrupt frequency is a fourth as fast.

What exactly does it mean to generate an interrupt? To understand this, you need to know what is normally happening when a microcontroller is running. When you program a microcontroller, you place the assembly instructions of your code into sequential program memory addresses. In the simplest case, a microcontroller performs the instructions in its program memory in order. If it just performed the instruction at address location 123, then it will run the instruction at location 1 24 next.

However, when an interrupt is generated, the micro- controller jumps to a fixed interrupt address instead of going to the next instruction. This special address is some- times called the interrupt vector and is often toward the beginning of the program memory. This location is where you put the start of your interrupt code. So, generating an interrupt really means making your microcontroller jump to a known address the start of your interrupt routine.

When the interrupt has done its work, you want the microprocessor to go back to whatever it was doing just before the interrupt happened. There is a special return- from-interrupt instruction that does just this. It signals that the interrupt processing is over and that the microcon- troller should go back to where it was prior to the interrupt.

One thing to keep in mind when using an interrupt is that you don’t want to overwrite variables you were using in your main code. This is especially true of the accumulator or working register and any status flags. Some microcon- trollers will store some of these important variables for you automatically and restore them at the end of the interrupt. If you are using a compiler, it will usually do this for you if

57

FEBRUARY 2005

CONFIDENTLY USING INTERRUPTS IN YOUR MICROCONTROLLER PROJECT

CL>

CD

ru

£

“j

PWM Period = Interrupts

255

Duty Cycle = 178

Interrupts

1

1

LT

Time

FIGURE 2. An oscilloscope trace of PWM generation using an interrupt with a 70% duty cycle.

the microcontroller doesn’t, but if you are writing assembly code directly you will want to copy the value of the accumulator and any processor flag registers into temporary variables at the start of your ISR and then

s

£

66

AN EXAMPLE INTERRUPT - GENERATING PWM ON A PIC16F84

The interrupt service routine code shown below generates a PWM signal on pin 0 of PORTB with the duty cycle set by the variable pwm_duty. A value of 0 specifies 0% PWM and a value of 255 specifies 100% PWM. Intermediate values scale linearly. Figure 2 shows what an oscilloscope trace looks like attached to the PWM pin with a pwm_duty value of 1 78. The SWAPF instruction is used to store the STATUS and W registers because it doesn’t affect the STATUS flags that we are trying to save.

into :

copy those values back into the registers at the end of the ISR just before the return-from-interrupt instruction.

To recap, the whole process happens as follows: Your microprocessor is performing instructions in the main body of your code. As this is happening, the timer is incrementing. When the timer rolls over from its maximum value to 0, the microcontroller jumps to the interrupt vector address in its program memory. It runs through the instructions of your interrupt routine until it reaches the return-from-interrupt instruction. It then jumps back to wherever it was when the interrupt was generated and keeps running.

Different microcontrollers can also generate interrupts under other specific conditions. For instance, many micro- controllers have special external interrupt pins or pins that can generate interrupts when their state changes. These interrupts operate in much the same way, apart from their triggering. The interrupt service rou- tines will have the same parts, except that they won’t need to reset the timer. When you are using more than one source to generate interrupts, you will need to check which source generated each interrupt at the beginning of your interrupt routine.

pwmO :

pwml :

pwmEnd:

ORG

0x04

; Interrupt vector location

MOVWF

w temp

; Save the W register

SWAPF

STATUS ,0

MOVWF

status_temp

; Save the STATUS register

BCF

INTCON, TO IF

; Clear interrupt flag

MOVLW

D'46'

SUBWF

TMR0, 1

; Subtract 46 from the timer

INCF

pwmjphase , 1

; Increment the phase

MOVLW

D' 255 '

SUBWF

pwmjphase , 0

BTFSS

STATUS, C

; If phase >= 255, reset

GOTO

pwml

CLRF

pwmjphase

; Reset phase

MOVF

pwm duty, 1

; If it's the PWM period start

BTFSS

STATUS ,Z

; Check if duty cycle is zero

BSF

PORTB, 0

; If not zero, start PWM pulse

GOTO

pwmEnd

MOVF

pwm duty, 0

SUBWF

pwmjphase , 0

; Subtract to compare

BTFSC

STATUS, C

BCF

PORTB, 0

; If phase >= duty, end PWM pulse

SWAPF

status temp , 0

MOVWF

STATUS

; Restore the STATUS register

SWAPF

w temp, 1

SWAPF

w_temp, 0

; Restore the W register

RETFIE

; Return from the interrupt

intEnd :

The Details

Setting Up and Using Interrupts

There are several things you need to do to get a periodic interrupt running on your microprocessor. I’ll talk about them in general and also give the specifics of getting a periodic interrupt running on the popular Microchip FIC16F84 processor clocked at 10 MHz. The PIC16F84 processor can be purchased from Digi-Key (www.digikey.com).

First, you will need to decide on the frequency of your interrupt. You will choose your interrupt frequency depending on the needs of your appli- cation. For our example, we will use the interrupt to generate a 255 step FWM signal on an I/O pin at 200 Hz to control a motor. Since we’ll need an interrupt for each step of the PWM, we’ll need 255 interrupts every 200 Hz, giving us a desired interrupt frequency of 51,000 Hz (200 Hz * 255 = 51,000 Hz).

Next, we need to figure out how many times the timer will increment between interrupts. To do this, we divide the frequency of the timer by our desired interrupt frequency. From the data sheet

58

FEBRUARY 2005

CONFIDENTLY USING INTERRUPTS IN YOUR MICROCONTROLLER PROJECT

for the PIC16F84, we know that TimerO which is used to generate interrupts increments once every instruction cycle (not using the prescaler). Also from the data sheet, we know that there is one instruction cycle for every four clock cycles, giving us an instruction cycle frequency of 2.5 MHz (10 MHz / 4 = 2.5 MHz). We now divide this by our desired interrupt fre- quency of 51,000 and we get 49.02 (2,500,000 / 51,000 = 49.02). Since we need an integer number of timer increments per interrupt, we round this to 49. So, the timer will increment 49 times from one interrupt to the next.

Now, the next fact we need to know is that TimerO causes an interrupt when it rolls over, when its value goes from 255 to 0 (255 is the maximum value for an eight-bit timer). From the last step in our calculation, we know that we want 49 increments between interrupts to get our desired frequency.

So, if we subtract 49 from the timer’s value during our interrupt, we know that the next interrupt will occur 49 cycles later than this one. This is how we set the interrupt frequency. If we don’t change the timer’s value during the interrupt, we will instead get interrupts every 256 cycles when the timer naturally rolls over.

Another thing to keep in mind is that you might have to adjust the value you subtract from the timer because you lose a few cycles doing the subtraction. This is because the timer value will continue to increment while you are doing the subtraction.

For instance, if reading the timer, subtracting, and writing the timer again takes three cycles, you will want to actually subtract 46 from the timer instead of 49. Otherwise, your inter- rupt frequency will be slightly off.

An alternate way to set the inter- rupt frequency is to load a constant value into the timer at the beginning of each interrupt. This method uses fewer instructions to set the timer, but is less accurate because it doesn’t take into account the interrupt latency.

The interrupt latency is the few instruction cycles it takes between the timer rolling over and the first instruc- tion of your interrupt service routine.

The interrupt latency varies for different microcontrollers and can also vary slightly from interrupt to interrupt, depending on the microcontroller.

When the latency varies slightly, so

will your interrupt frequency.

If we were to use this method in our example, what value would we need to load into the timer at the beginning of our interrupt so that 49 cycles later the timer will roll over? We subtract 49 from 256 (the timer rolls over one cycle after it reaches 255) and get an answer of 207. So, if we load a value of 207 into the timer at the beginning of our interrupt, the next interrupt will happen when the timer rolls over 49 cycles later. If you really need to make your interrupt routine short, this can be a good alternate way to set the interrupt rate.

MADE SIMPLE

BRING YOUR WIRELESS PR0BUCT QUICKLY ANR LEGALLY TO MARKET

m ElQMOi

Add INSTANT wireless analog / digital capability to your product.

Low-Cost TX & RX Modules

W^~

m

*

Multi-Channel Modules

oJ

Transceiver

Modules

FCC PRECERTIFIED & ready to customize for your application.

I Handheld TX’s Keyfob TX’s Function Modules a

Si 0SB

■>; =

chips to gain yagis, to WIFI.

Gain lit Antennas JL

IJIIJ

www.linxtechnologies.com

www.digikey.com

1-800-DIGI-KEY

www.rfdigital.com

1-818-541-7622

Circle #95 on the Reader Service Card.

59

FEBRUARY 2005

CONFIDENTLY USING INTERRUPTS IN YOUR MICROCONTROLLER PROJECT

Microcontrollers signal that an interrupt condition has been reached by setting a flag a bit in one of the system registers. For our timer interrupt, this flag is set when the timer rolls over. If that interrupt is enabled, this will trigger an actual interrupt. In most microcontrollers, you will need to clear this flag by hand in your interrupt routine or you will keep getting the same interrupt over and over. For our TimerO interrupt in the PIC16F84, this means clearing the TOIF bit with a BCF instruction.

The next step is writing your actual interrupt service routine. You already know a few things that need to appear in the routine. At the beginning, you need to save the state of important registers, clear the flag, and subtract your interrupt cycle value from the timer. At the end of the interrupt, you need to restore the register values you saved and then have a return-from-interrupt instruction. The return-from-interrupt instruction is always the last instruction of your interrupt service routine.

Here are the tasks that you will need to do in each of your interrupt service routines (See the interrupt service routine in the sidebar for a specific example.):

1. Save the values of the system registers you use in the interrupt.

2. Subtract from the timer the “timer increments per

Learn Wireless Communication Technology and FCC License Preparation at HOME!

Free Information Packet

Prepare today for a new challenging and exciting career. Our Distance Learning Program is designed to train you at home in your spare time. Call today to get started.

Our new program in Wireless Communication Technology can open up a new world of income opportunities for YOU and NO classroom attendance is required.

Send to Aii, Inc., Dept. N&V 1203 - 2725 College St., Jacksonville, FL 32205

M

£

i<*

Name,

Address _

. Age_

City/State _

-Ph:( ).

ZIP

Atlantic International Institute, Inc.

www.Aiilearn.com Email: info@aiilearn.com

Call TODAY For free Information Packet

Toll FREE 1-800-658-1180

60

interrupt” value you calculated.

3. Clear the interrupt flag.

4. Write the body of your interrupt. In our example, this is the FWM generation code.

5. Restore the system register values that you saved.

6. End your interrupt routine with the return-from-interrupt instruction.

The final step to getting your interrupt running is to set the hardware bits that enable the interrupt and the timer. Most microcontrollers have both a global interrupt enable bit and bits that enable each individual type of interrupt. When the global interrupt enable bit is not set, all interrupts in the microcontroller are disabled. For an interrupt to be enabled, both the global and the individual interrupt enable bits must be set.

In the PIC16F84, you can set these bits directly using the BSF instruction. The global interrupt enable bit is named GIE and the TimerO interrupt enable bit is named TOIE. You also need to set up and enable the timer so that it starts incrementing every instruction cycle. In my example, I set the PSA bit to have no prescaler and set the TOCS bit to start the timer incrementing. You only need to set these values once, unless you want to turn the interrupts on and off. I usually set them in an initialization section at the beginning of my main body of code.

If you are writing your interrupt routines in a C compiler, the compiler may take care of some of these details for you. It will probably enable you to write the body of your interrupt routine in a special interrupt function. From this function, it will generate the assembly code and place the routine at the correct interrupt vector address and also save the state variables for you. Some microcontrollers also automatically save the important registers for you whenever an interrupt occurs and then restore them when the interrupt is over. Refer to your microcontroller’s data sheet to see if it saves any register values automatically.

One general rule to remember is to keep your interrupt code short. This is a solid principle, but it doesn’t mean that you can’t do any processing in your interrupt. The thing you want to absolutely avoid is for the next interrupt to occur when the last one is still running. In our example, we generate an interrupt every 49 instruction cycles. So, it’s clear to see that if our interrupt takes more than 49 instructions to run the next interrupt will want to run before the current one is over. This is a problem and it means that the main body of your code will never get to run.

The longer your interrupt routine, the less processing time is left for your main code. Because of branches in your code, the number of instruction cycles it takes to run can vary from interrupt to interrupt. In practice, I’ve found that interrupt routines can take up 50% of the time between interrupts without causing problems. In our example, this would mean an interrupt routine that runs in 24 instructions or less. Overall, shorter is usually better.

FEBRUARY 2005

CONFIDENTLY USING INTERRUPTS IN YOUR MICROCONTROLLER PROJECT

How to Know It’s Working

Now that you’re done writing your interrupt code, how do you confirm that you did everything right? It is really easy to debug an interrupt if you have an oscilloscope. Add two more instructions to the main body of your interrupt routine. At the very beginning of the body, set one of your microcontroller pins high. On the PIC16F84, you can use the BSF and BCF instructions to set just one pin at a time. At the end of the interrupt body, set the same pin low. Then, run your applica- tion and hook an oscilloscope to the pin. You should see an oscilloscope trace like the one shown in Figure 1. The time from the beginning of one pulse to the next is the period of your interrupt. The width of each pulse divided by the period gives you the approximate percentage of processing time that your interrupt is using. Keep in mind that this doesn’t take into account the latency or the set-up and ending instructions. The real time taken by the interrupt is a bit more.

If you don’t have an oscilloscope, there are still easy ways to check that your interrupts are running and at the right frequency. A good debugging tool is an LED hooked up to one of your microcontroller pins. If you did what I explained above, the LED would blink, but it would blink so fast that you would never be able to see it. So, you need to slow down the blinking by incrementing a counter. In our example, the interrupt rate

is 51,000 Hz. If we divide the frequency down by 51,000, our LED will blink on for a second and then off for a second. We can use two cascading eight-bit timers or one 16-bit timer to accomplish this. For the eight-bit case, you would increment your first timer in each interrupt. Whenever this timer rolled over (from 255 to 0), you would increment your second timer. When the second timer reached 200, you would set it back to 0 and flip the state of your pin from high to low or low to high. In this way, you can confirm that your interrupt is running and running at the right rate because the LED is blinking on for a second and then off for a second.

Once you have your first interrupt running, you will know all the basics of using interrupts. These same methods will work on any microcontroller, with slight changes to handle the specifics of the hardware. As you become comfortable using interrupts, you will start to find more uses for them in all of your microcontroller projects. NV

ABOUT THE AUTHOR

Phil Mass developed all of the software in the original Roomba robot vacuum cleaner while at iRobot Corp. He now has his own company, Element Products, Inc. (www.elementinc.com), specializing in product development consulting. He can be reached at pmass@ elementinc.com

mouser.com

ENGINEERED FOR ENGINEERS

448,000+ Electronic Components Over 255,000 Spec Sheets

New Products,

New Suppliers,

New Technologies,

New Catalog Every 90 Days!

MOUSER

ELECTRONICS

a tti company

(800) 346-6873 www.mouser.com

Mouser® and Mouser Electronics® are trademarks of Mouser Electronics, Inc.

Parts List Software

for Engineers and ^Designers

Easily create and manage multi-level parts lists for products in development.. .and after.

Track sources for items with multiple price breaks.

Calculate product costs at any quantity.

Launch CAD, viewer or browser from any Item.

Automatically generate RFQs or POs.

New Version 5. 0

New Report Layout Editor customizes reports/labels.

New Connection to QuickBooks 2002/2003 Pro simplifies accounting (us

version only).

New Multi-currency for foreign suppliers eases exchange rate calculations.

Vendors

Visit www.trilogydesign.com and download our FREE DEMO.

For Windows 98/NT/M e/2 K/XP 3 Editions, starting at $99 + s/h

Or, Call 800-280-5176

530-273-1985 Fax 530-477-9106 P.O. Box 2270, crass Valley, CA 95945

61

Circle #101 on the Reader Service Card.

TH£ PID CONTROLLER

In Part 1, we layed the foundation for the Proportional Integral Derivative PID controller. Using a simple, intuitive approach, we explored what each term represents. We exam- ined how simple op-amp circuits could be used to construct the individual elements. In Part 2, we will see a complete analog PID system. We will explore the dynamic operation of the PID control system. We will explore how to operate and tune a PID controller. Using our servo motor example, we will explore system stability. We will learn new terms, such as overshoot, dampening, and oscillation. We will see how the individual P, I, and D terms come together to form a complete control system.

Last month, we came to several conclusions about each of the P, I, and D terms. These concepts are very important to our present discussion, so we will review them again. You can follow along with the block diagram shown in Figure 1 .

Proportional Concepts (PRO)

A system will try to correct the error between the set point and the measured output. It does this by commanding the system in a direction that opposes the error. The intensity of the correction is determined by proportional gain. The proportional component provides a correction only if there is an error!

Integral Concepts (INT)

Part 2

by Aaron Dahlen

The integral section operates when an error is present. It accumulates this error over time. Therefore, a small error can become a large correction, given enough time. As the error is accumulated, the system will be forced to correct the error. Finally, the integrator will overshoot the set point. An error opposite of the original is required to discharge the capacitor.

!<#

Why is the sky blue ? Why do birds sing? Why do I have 1 0 fingers? We all asked these questions when we were children. When I started to learn about control systems, I felt just like a kid again. I asked all sorts of questions. Why does a system overshoot? Why can't I turn the gain up higher? Why is this system oscillating? It’s wonderful to be like a child again. There is so much to be learned.

!{2 Derivative Concepts (DIF)

ID

62

The output of the differentiator is proportional to the speed of the system. If the system is moving fast, the output

FEBRUARY 2005

THE PID COIlTROLLffi - Part 2

is high and vice versa. If the motor is not moving, the differential output will be zero. The differential term is applied in such a way as to slow down the motor.

Circuitry

A simplified schematic for the PID controller was printed in Part 1. A new, more advanced, schematic is presented here as Schematic 1. A new circuit has been added consisting of IC3A, IC3B, and IC1. Again, this circuit is an adaptation of the PID controller presented by Professor Jacob in his book, Industrial Control Electronics.

This new circuit is designed to prevent the integrator circuit from functioning under certain conditions. The reasons for this added feature will be explained later in this article. The analog switch (Maxim MAX318) disables the integrator by shorting the integrator’s input to ground. The analog switch is driven by op-amps IC3A and IC3B. This pair of op-amps forms what is commonly called a window detector. The name refers to the “window” of voltage where the op-amps have a low output (allow the integrator to function). If the output of the PID controller is above or below a certain point, the op-amps will turn on the analog switch, thereby disabling the integrator.

Construction

The circuit board shown in Photo 1 was designed for

flGUfi£1. Block diagram of the DIP controller and servo motor.

this article. You can download the CAD files (Eagle) from the Nuts & Volts website at www.nutsvolts.com The CAD file is slightly different than the board shown here. I made a few minor modifications/improvements to the board. Feel free to use the CAD files as you see fit. In case you were wondering, Advanced Circuits manufactured this board. I am very happy with their service. Check out their website at www.4pcb.com/ look for their bare bones special.

As an alternative to the PCB, you could construct the circuit using “dead bug” or perfboard construction. The layout isn’t critical. I was able to breadboard this circuit successfully. Just remember to keep the wire runs short and decouple the op-amps.

What Are We Controlling?

We will be controlling the position of a servo motor. Our servo motor is a mechanical device. Yes, this is an obvious

SCH£(TlflTIC 1. The advanced PID controller schematic.

FEBRUARY 2005 53

THE PID COnTHOLLER - Part 2

flGUR£ 2. Delayed response of a modified HiTec HS-322 servo: blue = voltage applied to motor; red = motor response as measured via resistor.

statement, but take a moment to think about the attributes of a mechanical system. The moving parts of a motor have mass. Consequently, they have inertia and momentum. It takes a finite amount of time before the motor will respond. It takes time and energy to get the motor armature, gears, and load moving. Figure 2 shows how the modified HiTec HS-322 R/C servo motor responds when a 6 VDC signal is applied. We see that it takes approximately 20 mS before the motor even starts to move. Conversely, once the motor is moving, it does not want to slow down.

The motor is also an electrical device again an obvi- ous statement. The motor windings have the characteristics of an inductor and a resistor. Recall that an inductor works to keep the current constant. Consequently, when the motor is turned off, there is no current flow. When the voltage is first applied, the inductance of the windings tries to keep the current at zero. Therefore, the motor

inductance accounts for some of the delay seen in Figure 2. The motor resistance also limits the amount of current and, thus, the torque that the motor can deliver.

How Do I Connect the Servo Motor?

In a word, carefully! Things can get out of control when designing and experimenting with control systems. In preparing this article, I stripped no less than three sets of gears out of the servo motors! After that, I got smart and added limit switches to the servo. Also, it is a good idea to put a current-limiting resistor in series with the motor 1 0 to 20 ohms works nicely.

The FID loop requires negative feedback. If either the motor or feedback resistor is installed incorrectly, we will have positive feedback and the system will go nuts. Remember those limit switches!

When we first connect the PID, it is best to disable the integrator and differentiator. The integrator is disabled by shorting out the feedback capacitor. The differentiator is disabled by shorting out the resistor connected between IC3D and ground. These components are marked on Schematic 1. On my circuit board, I have added headers to facilitate this process. Just add a shunt on top of the headers to disable the integrator’s derivative section.

The motor and feedback resistor should be connected to the circuit. If possible, do not physically connect the motor shaft to the feedback resistor. If you are using a servo, the top may be opened and the final gear removed. Short the set point, i.e., 0 volts input. Apply power to the system. The motor will most likely turn. Move the feed- back resistor. You should be able to make the motor change directions. The motor should turn in a direction opposite that of the feedback resistor. If it doesn’t, reverse the polarity of the motor.

At this point, we can physically connect the motor and the feedback resistor. Be ready to disconnect the power. Things can get out of hand quickly. When power is

FEBRUARY 2005

THE PID COIlTROLLffl - Part 2

applied, the motor will either move the feedback resistor to midrange or the system will oscillate back and forth. If the system oscillates, decrease the proportional gain.

How Do I Tune a PID Controller?

This question is a bit like asking how to ride a bike. The best answer is to just do it. I chose the servo motor example as the basis of this article because it operates at just the right speed. The system is slow enough so that we can see what is happening, but not so slow that we have to wait to see our changes. This is nice because we can quickly tune the system. Taking this analogy further tuning a PID controller is like riding a bicycle. We are trying to balance three criteria, as shown in Figure 3. An ideal system would be unconditionally stable. It would respond instantaneously to an input and it would have no error, i.e., it would go exactly where we tell it to.

There is no such thing as an ideal system and our servo motor is no exception. We already know that the servo motor is a slow device. It takes over 20 mS before the motor starts moving. We also know that it will not stop instantaneously. Once it is moving, the momentum will keep it moving.

In real systems, we are left with compromises. We are left to balance stability, rise time, and steady state error. Let me explain using a series of oscilloscope views. The test set-up used to capture the “oscillographs” is shown in Photo 2. In the following sections, we will observe the “step response” of the servo motor system.

A step input is nothing more than a square wave. We are telling the servo motor to instantly move from one position to another. The blue line represents the step function applied to the input. The red line represents the actual response of the servo mechanism, as measured at the feedback resistor.

fIGURf 4. Proportional only control has a fast rise time uoith considerable overshoot and oscillation around the set point: blue = set-point; red = feedback from resistor.

Proportional Control

We will first examine how the servo motor responds to changes in proportional gain. The integrator and differentiator should be disabled at this time. When we adjust the propor- tional gain, we are adjusting how hard the system will be driven. Higher proportional gains send more current to the motor. The motor will develop more torque and, as a result, will move faster. This results in a more responsive system that is better able to follow the set point. However, there is a limit, as can be seen in Figure 4. The curve in Figure 4 is a classic example of an “under damped” system. In an under damped system, the system is seen to oscillate about the set point in response to a step input. The system is optimized for rise time. The final steady state error is minimal.

In Figure 5, we see what happens when the proportional

fIGUtiE 5. The proportional gain is loiuered, resulting in a critically damped response and long risetime: blue = set point; red = feedback from resistor.

65

FEBRUARY 2005

THE PID COnTHOLLER - Part 2

gain is lowered. This figure shows a classic “critically damped” system. The response is as fast as possible without overshoot. If the gain was increased, the system would overshoot and oscillate, as seen in Figure 4. If the gain was lowered, the system would be “over damped” and would take even longer to arrive at the set point.

The critically damped system is optimized for stability. The risetime performance has decreased considerably. To repeat, Figures 4 and 5 show how changes in proportional gain affect the response of the system. For many applica- tions, this type of control is sufficient. However, better response can be obtained with a more complicated system.

Proportional Plus Derivative Control

Recall that the derivative term is a measure of how fast the servo motor is moving. The derivative component is added to the PID result in such a way as to slow the motor down. In Figure 4, we saw how the servo motor

bobbled around the set point. Figure 6 shows how the servo motor responds with derivative control added. The resulting system is stable and has a good rise time.

A close comparison of Figures 4 and 6 reveals how derivative control functions:

In both diagrams, the initial motor response is identical.

The overall maximum speed of the motor is slower in Figure 6 (less slope).

Since the maximum speed is less in Figure 6, the motor does not overshoot.

Just like the proportional control, there is a limit to how much derivative control may be added to the system, but too much derivative control will make the system unstable.

Proportional Plus Derivative Plus Integral Control

To understand integral control, we must first explore the limits of PID control. In Figure 7, we see how the servo motor responds under a load. The servo motor is unable to reach the set point; the blue and red lines do not merge.

From the previous discussion, we know this is a limitation of the proportional terms. We can rule out the derivative term, since it only functions to slow the motor down when it is moving fast. Recall from Part 1 that the proportional system only functions when there is an error.

The simple illustration in Figure 8 will help to explain why the proportional control is not able to eliminate the error. In Figure 8, we see that the motor is holding a weight stationary. Gravity is pulling against this weight. The motor must apply a torque which counteracts the effect of gravity. Without power, the motor would develop no torque and the weight would fall. Recall that the

%/%

$

FIGURE 6. Proportional plus derivative control results in fast rise time with no overshoot: blue = set point; red = feedback from resistor.

FIGURE 7. Proportional plus derivative control under load. The servo is unable to settle at the set point: blue = set point; red = feedback from resistor.

66

FEBRUARY 2005

THE PID COIlTROLLffi - Part 2

proportional term is proportional to the system error. Therein lies the problem with proportional control.

This one took a while for me to understand, but it makes sense when you think about it. The error cannot be eliminated. If the error was zero, the proportional drive would be zero, and the weight would fall. Therefore, in a set-up such as that in Figure 8, there will always be an error. The blue and red lines can never converge. In Figure 9, we see how the integral component can improve the steady state error of our servo motor system. Recall that the integral accumulates the error over a period of time. In Figure 9, we see that the servo motor has overshot the set point, just like in Figure 7. Since the error is not zero, the integrator will start to accumulate the error. After a period of time, the integrator output is high enough to move the motor, as seen in Figure 8. The steady state error is, therefore, reduced.

To better understand the integral, let’s look at what happens when we increase the integral gain. As you can see from Figure 10, things can get ugly. There are two problems with this system: overshoot and oscillation.

The overshoot is caused by the rapid accumulation of error. A large error exists for a period of time when the motor is commanded to move. This large error is accumu- lated by the integrator. This is called “integral wind-up.” If we were to look at the output of the integrator with an

IS/div

IV/div

t * * » > . 4 4 4 .J

L 4 » * .

"i " "

II i | | ||j , , ,

...

ail

Integral action

+ + r 1 y +■ f \

\ 1 miuui J

. .

flGUflt 9. Proportional plus integral plus differential control under heavy load. The servo returns to the set point with time: blue = set point; red = feedback from resistor.

oscilloscope, we would see that the capacitor is fully charged, i.e., the integrator has saturated. This is not a good thing! Recall that the capacitor will not discharge until the error has changed signs. This means that the servo

RF Modules

WWW.ABACaM-TECH.CDM

liffiABACOM

Technologies

Tel: +1(416)236 3858 Fax: +1(416)236 8866

abacom@abacom-tech.com

New 1 Watt 9XTend Stand-Alone RF Modem

The best price-to-performance value on the market

Features

MaxStream’s

9XTend

Low Cost Competitor

High Cost Competitor

Price

$300

^ < $300

O > $1,200

Max. Range

line-of-sight

0 Up to 40 Mi.

O Up to 20 Mi.

^ Up to 60 Mi. i

Data Throughput

^115 kbps

O 57 kbps

^115 kbps 1

Encryption

^256-Bit AES

O 56-Bit DES

O None J

Max. Sensitivity

^-110 dBm

O -99 dBm

^-110 dBm 1

Interference

Immunitv

★YES

O NO

★YES 1

Call for aggressive volume discounts & development specials.

RS-232/485

MaxStream

www. maxstream . net toll-free 866-765-9885

Circle #32 on the Reader Service Card.

FEBRUARY 2005

fIGURtlO. Proportional plus integral plus differential control under heavy load. Setting integral gain results in overshoot: blue = set point; red = feedback from resistor.

IS/div

IV/div

11 X .

A. . Ar-

1

ii i i

L.U..L..J...L..I _t k 4_,

4 , . 1.

f

.. !

It 1 I | r *■

flGUR£11. Proportional plus integral plus differential control under heavy load. The integral lockout circuit prevents overshoot: blue = set point; red = feedback from resistor.

motor must overshoot to discharge the capacitor.

The oscillation seen in Figure 10 has an inherent prob- lem with the integrator. The problem is with the very action of the integrator itself. Let me explain with an example:

1. Assume an error exists.

2. The integrator will accumulate this error over time. Therefore, output of the accumulator slowly rises.

3. The motor will move when the integrator output is suffi- ciently high. The required voltage level is determined by the motor inertia and the mechanical resistance.

4. Once in motion, the motor will continue moving.

5. In most cases, the motor will overshoot the set point and will start this process over again.

%/%

b

£

!<#

ly*

The overshoot is exacerbated by high integral gain. Unfortunately, the effect is also observed with low gains. The system may or may not settle at the set point. However, if the error is zero and the motor is not moving, the system will be in a state of equilibrium and all move- ment will stop. For the servo motor systems presented in this article, the settling process may take several seconds.

The operation of the integrator may be improved by the additional circuitry shown in Schematic 1 . The analog switch we examined earlier helps to stabilize the integral. It does this by disabling the accumulation action if the motor drive is above a particular point.

Figure 1 1 shows how the system’s performance is improved by adding the analog switch. The integral gain in this figure is the same as in Figure 10. The overshoot has been eliminated; unfortunately, the oscillation remains.

Tuning Summarized

Tuning a FID controller is like riding a bike. You have

to keep your eye on system stability, rise time, and steady state error. I have the following rules of thumb to help you:

Proportional gain determines how fast the system corrects a relatively large error. Increase the proportional gain for faster system response. If the term is too high, the system will overshoot and may oscillate around the set point.

Derivative gain is adjusted after monitoring the system performance. Increase the derivative gain if the system has a large overshoot in response to step input. If the derivative gain is set too high, the system will again oscillate.

Integral gain is adjusted to control the performance of the system when it is near the set point. Increasing integral gain will make the system quickly return to the set point. Decrease the integral gain if the system starts to oscillate.

My advice to you is to get out there and try to tune a FID system. We all learn best by doing. The servo motor system presented in this article is very responsive and easy to tune. The lessons learned are applicable to other systems. The worst that can happen is that you will strip a few gears! Also, read, read, read there are many well-written texts to guide you in this process. As a starting point, I recommend that everyone get a copy of Professor Jacob’s Industrial Control Electronics.

Stay tuned; in Part 3, we will go high tech. We will take the lessons learned in the analog world and apply them to a digital PID controller. NV

R£f€fl€nC€

Jacob, Michael. Industrial Control Electronics. New Jersey: Prentice Hall, 1988.

68

FEBRUARY 2005

Wtm

By David W>

PLCs or programmable logic controllers are industrial grade stand-alone computers that typically do not have monitors, keyboards, or mice attached to them as they operate. A stroll through almost any industrial plant of about any size will usually reveal dozens and dozens of FLCs controlling industrial processes ranging from con- trol of simple conveyor belts up to specialized industrial machinery designed to automate extremely complex manufacturing processes.

In the past, the FLCs themselves and the specialized software needed to communicate with and program them have been expensive and out of the reach of individuals outside of industry. Recently, Allen Bradley and Rockwell Software have been marketing the Micrologix 1000 bulletin 1761 series of PLCs that range in cost from $99.00 up to $189.00 for their most basic models (Photo 1). They are also offering their RSLogix 500 starter software for these basic models only as a free download from their website (www.ab.com).

There are other low cost PLCs and software available from other vendors, as well. This article, however, will only deal with the Allen Bradley Micrologix 1000 units. There are millions of PLCs being used in all aspects of manufacturing and in many other applications. Anyone working in the fields of electronics, computers, or programming can benefit from gaining a little knowledge about PLCs.

There is a lot of information that is needed to begin working with PLCs, so this will be the first article of two. This first installment will demonstrate how to begin programming in “ladder logic,” how to get a program into a PLC, and how to run and monitor the operation of a PLC program. The second article will present a more complicated ladder logic project a roll-up door opener controller and look at the way PLCs execute their programs. After reading these two articles, I am sure that you will come up with several PLC applications that you would like to implement.

Ladder logic programming is a graphical program- ming language adapted from ladder logic diagrams used

by industrial electricians to hardwire relay logic circuitry. Using a graphical ladder logic program for programming PLCs has made the transition from reading ladder dia- grams to writing software for PLCs easier for industrial electricians. For those who have already been involved in software programming, ladder logic programming will probably be quite a change, although most of the commands and features available in a typical programming language are available in ladder logic programming, as well.

To become proficient in PLC programming requires more information than can be put into a single article; this article is intended to be an introduction to get you up and going with simple examples. For further ladder logic programming examples and instruction, I recommend the text Technician's Guide to Programmable Controllers, fourth edition, by Richard A. Cox. It’s published by Delmar and the ISBN is 0-7668-1427-0.

The first item to discuss will be which model PLC to purchase. Allen Bradley refers to their Micrologix 1000 family as “Bulletin 1761” devices. There are several models of Micrologix 1000 units available with several options to choose from in each model. The unit demonstrated in

FEBRUARY 2005

69

§TT^[f IFIL^a

i/i

£

!o8

I

¥

this article will be the Allen Bradley catalog number “1761-L10BWA” model, which is their most basic 10-point FLC unit (see Photo 2).

There are three 10-point models available: the 1761- L10BWA, the 1761-L10BWB, and the 1761-L10BXB. All three models have six 24 VDC input terminals. This is what the first letter “B” in the part numbers refers to. The letter following the letter “B” is either a “W” for electromechanic relay outputs or an “X” for relays and 24 VDC FET (field effect transistor) outputs. All three units have four outputs. The third letter in the series is either an “A” for 120 VAC power or a “B” for 24 VDC to power the PLC itself. Other PLC models may have a number and a letter following those shown above; for example, “5A” would indicate that the unit has five analog I/O (Input/Output) pins.

Adding analog I/O to a PLC increases the cost substantially. To summarize, the basic Micrologix 1000 unit (catalog number 1761-L10BWA) demonstrated in this article has six 24 VDC input terminals, four electro- mechanic relay outputs, requiring eight screw terminals (two per relay), and 120 VAC to power the PLC itself. This unit has no analog inputs or outputs. The inputs and outputs are strictly discrete in nature or either ON or OFF. Therefore, this unit cannot be used to input analog signals, such as a varying voltage or current coming from a temperature sensor.

The first circuit that will be demonstrated on the PLC is a typical start/stop motor control circuit that is commonly found controlling industrial motors (Figure 1). In a typical hardwired start/stop circuit, the LI line would be connected to the “hot” line of 120 VAC. The L2 line would be connected to the neutral or ground wire. The stop button is a normally-closed (NC) momentary push-button. The start button is a normally open (NO) momentary push-button. CR1 is the motor contactor winding.

The hold-in contacts parallel to the start button are auxiliary contacts on the motor contactor and will be closed when CR1 is energized. This contact allows the user to press and release the start button and not have to hold it in to keep the motor running. The actual motor itself and the connections to it are not usually shown on the ladder diagram. This circuit can be used to control the starting and stopping of any type of electrical motor.

If the start button is pressed and the stop button is not pressed, CR1 becomes energized and closes the hold-in contacts, as well as the actual motor contacts that will supply power to the motor itself. Since the hold-in contacts are closed and are parallel to the start button, releasing the start button will not de-energize CR1 and the motor will keep running. If the stop button is pressed, the power path to CR1 is broken, so the motor contactor releases and stops power flow to the motor, as well as to the hold-in contacts, and the motor stops. This would also occur if there was a power failure or if the start/stop wiring was damaged or if the NC stop push-button was not operating properly. The motor cannot start again even if the power comes on after a power failure until the start push-button is pressed.

Now, let’s connect this circuit up through the PLC and try it out. At this point in time, you may be asking the question, “Why use a complicated PLC to do what is already being done without a PLC?” This is a valid question. One answer to that question is that, once the circuit is operating through the PLC, many software options will become available and can be adjusted and experimented with quite easily through software changes without adding any further hardware items.

For example, if you wanted to make the operator hold the start button in for several seconds before the motor was actually energized perhaps for safety reasons the hardwired circuit would require more hardware like a delay-on timer. Using the PLC, we can simply add a delay-on timer in our software and easily change its settings at any time. To connect the push- buttons to the PLC, we will connect +24 VDC to one terminal of both the stop push-button and the start push-button.

The other terminals of each push-button can then be connected to any of the six inputs

Li

12

START

STOP

. T .

1— /

ii

CR1

V

r

■0"

FIGURE 1

70

FEBRUARY 2005

PLC WIRING CONNECTIONS

INPUT SIDE POWER

on the FLC it doesn’t matter which ones but, for the sake of consistency, let’s connect the stop push-button to the first input, input 0 (10), and the start push-button to the second input, input 1 (II). It will also be necessary to connect the negative side of the 24 VDC supply to the two DC COM or common terminals on the input side of the PLC. Supplying the positive 24 VDC to the input devices and connecting the negative to the DC COM terminals is referred to as sinking the inputs.

The opposite of sinking is sourcing of the inputs and can be done by connecting the positive 24 VDC to the DC COM terminals and the negative of the 24 VDC to the input devices. There are two DC COM terminals so that some of the inputs could be sourced and the others sunk, if desired.

In this case, we’ll keep it simple and sink all six inputs. When +24 VDC is applied to each terminal, it will become a “true” condition and its corresponding LED will light up. If you are going to connect the output of the PLC to a circuit at this time, be sure that it is compatible with the relay’s voltage and current limitations of 24 VAC at 2.5A (Figure 2).

If your motor contactor requires a higher voltage and/or current than the PLC relays can handle, you’ll need to connect an interposing relay between the PLC and the motor contactor that falls within the PLC’s relay ratings. When the PLC’s output becomes true, you will hear its relay click closed and see its corresponding LED light up. So, even if there is no load connected to the PLC, you can determine if it is working properly.

Now, it is time to enter the ladder logic information into RSLogix and get the compiled program into the PLC for testing. It is assumed at this point that RSLogix and RSLinx are already installed onto your PC. Open RSLogix and select the FILE | NEW pull-down menu. Scroll through the processor list until you find “Bui. 1761 Micrologix 1000.” You can enter a processor name if you like at this time. If you give the processor a name such as “STARTER” then, whenever a PC is connected to the PLC, it will show the processor’s name.

This is important if your PLCs are networked together and you want to know which PLC is which by name or function.

After you select “OK” from the processor selection window, you should have a blank ladder diagram called

FEBRUARY 2005

“LAD2” with one rung numbered “0000” and the label “END” located on the right side of the rung. Now, you can insert new rungs by left-clicking on the rung number located on the left-hand side of the rung. Then right-click and, from the pull-down menu, select “insert rung.” You should now have two rungs visible rung 0000 and rung 0001.

You can now place the ladder logic symbols onto rung 0000 by first selecting the rung, then left-clicking on the rung number. It will turn red. Next, left-click on the symbols from the user symbols tool bar located just above the ladder diagram window. Place an XIC (examine if closed) symbol it looks like an NO contact down for the stop push-button. Place another XIC symbol down for the start push-button and, finally, place an OTE (output enable) symbol it looks like a pair of brackets down

M

£

on the right side of the rung for the CR1 motor contac- tor coil. Your ladder diagram should look like the one in Figure 3.

If you are having trouble determining which symbol is which, simply place the cursor over each symbol shown in the user symbol tool bar and a pop-up label identifying it should appear. You may wonder why an XIC symbol looks like an NO contact, but is used for the NC stop push-button instead of an XIO (examine if open) symbol, which has a diagonal line through it like the NC contact symbol. The reason for this is that, when the stop button is not pressed, power will be applied to the 1:0/0 screw terminal, making it true; when the stop button is depressed, power will not reach the 1:0/0 screw terminal and the XIC test will be false. Therefore, the entire rung will be false. If an XIO symbol were used here instead, the operator would have to hold the stop and start buttons in simultaneously to get the output to be true or to come on.

We will add the hold-in contacts parallel to the start button at a later point in time. The question marks located above each symbol are there because we did not enter addresses for the symbols when we placed them on the rung. To enter their addresses, double left-click on the question marks and enter: 1:0/0 for the stop push-button, 1:0/1 for the start push-button, and 0:0/0 for the OTE symbol on the right side of the rung. When you hit the enter key after entering each address, you will get a description and the symbol editor window. You can name

each symbol, as shown in Figure 4.

Labeling the symbols is a nice feature because, once a symbol has been named, you can type in the symbol name rather than having to type in the address. Later, when the hold-in contacts parallel to the start push-button are added, we can type in “CR1” instead of 0:0/0 and the software will assign the correct address to the label name automatically.

A few points about PLC addressing should be made at this time. Inputs are labeled with the letter “I” and outputs with the letter “O.” A colon then follows and then the number “0.” On other rack-mounted and expandable FLCs, other numbers may follow the colon, but this Micrologix 1000 PLC model is not expandable, so the first number following the colon will always be the number “0.” Next, there is a forward slash and, finally, the particular input or output terminal number. The possible input addresses for the six Micrologix 1000 10-point PLC inputs are: 1:0/0, 1:0/1, 1:0/2, 1:0/3, 1:0/4, and 1:0/5. The possible output addresses for the four outputs are: 0:0/0, 0:0/1, 0:0/2, and 0:0/3. Make sure to place a number “0” where necessary and not the letter “O” and vice versa.

Next, you can test your ladder diagram to see if RSLogix can understand and compile it properly. Do this by clicking on the verify project icon, which is a PC with a green check mark on it that is located above the user symbol tool bar. If there are no problems with your program, you will see the message, “verify has completed, no errors found” in the lower left corner of the screen. If errors are found, a window will appear at the bottom of the screen that will indicate which rungs have problems and which instructions on that rung have errors. Double- clicking on the error messages will cause the cursor to go to the symbol with that error.

Once the ladder diagram has been successfully verified, it is time to connect the PLC to the PC and download the program into the PLC. First, though, the communications software, RSLinx Lite, will need to be configured and enabled and the proper cable will need to be connected between the PC and the PLC.

Micrologix 1000 PLCs communicate through a special serial cable with the PC’s serial port. It is part number 1761-CBL-PM02, series B cable (Photo 3). The cable costs about $55.00.

Allen Bradley also supplies all of the necessary infor- mation needed to make your own cable. The cable uses an eight-pin male mini DIN connector on the PLC end and a DB-9 female connector on the PC end. Note, however,

72

FEBRUARY 2005

1761-CBL-PM02 Series B Cable

8--o< r-o< 6-

9-pin D-she

Programming Device 9-Pin

Controller

8-Pin

that the eight-pin mini DIN con- nector is not the same exact con- nector as those found on a PC’s mouse or keyboard. Six wires are needed to make a cable and the DB-9 connector requires one loop-back wire to itself (Figure 5).

To open RSLinx Lite from Windows, select START | PRO- GRAMS | Rockwell Software |

RSLinx | RSLinx. Then, select communications from the pull- down menu, select configure drivers, and click on the add new button. You can rename the RSLinx driver or leave it at its default name, AB_DF1-1. When the configure window opens, you can select auto configure if you are connected to the PLC or you can manually configure the settings, as shown in Figure 6.

Note that the communica- tions set-up shown in Figure 6 is working through Comm Port 3.

The laptop computer that this set-up was being demonstrated on uses com port 3 for the DB-9 male connector at the back of the PC. You can have all kinds of problems trying to configure and activate RSLinx if another device has taken control over the serial port first and vice versa. For example, I also use my laptop to synchronize my PDA through the serial port and, unless I go in and manually deactivate the serial port communications in my PDA software, RSLinx cannot open the serial port to reconfigure it. Also, RSLinx may come up when the computer boots up and take control of the serial port before other devices that need it can.

To prevent RSLogix from running all of the time, from Windows select: START | PROGRAMS | Rockwell software | RSLinx | Launch RSLinx Control Panel and then uncheck the “Always Run As Service” check box. You can also click on the stop button if you want RSLinx to stop running (Figure 7).

With RSLinx configured and running, you can communicate with the PLC and “Download” your program from the PC to the PLC or “Upload” what’s in the PLC to the PC. Let’s download the simple motor starter program by first verifying that the ladder diagram has no obvious errors. Then, go to the pull-down menu located in the upper-left corner that is now set at “Offline.” Change it to “Download.” You will then be prompted for a revision number; you can enter it or click “OK.” You are then prompted by a window which asks, “Are you sure you want to proceed with Download?” Select “Yes.” Next, a

window will ask, “SLC is in remote RUN MODE, processor must be switched to remote PROG mode, continue?” Select “Yes.”

73

FEBRUARY 2005

With

] IPIL®©

You will see an information window showing you the progress of the download. A window will then ask, “Change back to Run Mode?” Select “Yes.” Another window then asks, “Do you want to go Online?” Select “Yes.” You should now see the online/offline pull-down box displaying “REMOTE RUN.” The colorful ladder icon should also be spinning around, indicating that you are online with the PLC and your ladder diagram symbols

ABOUT THE AUTHOR

Dave Ward has been teaching Electronics Engineering Technology courses at Southern Utah University since 1 985. His hobbies include: amateur radio (N7HYA), robotics (SUU has a GM Fanuc industrial robot), radio controlled airplanes, four wheeling, mountain biking, and snowmobiling. Dave has been teaching electronics since 1976. He earned his bachelor's and master's degrees in technology education from Brigham Young University.

should change to a green color as your inputs and outputs become “true.”

As you press your start and stop push-buttons, you should be able to turn the output relay on and off. You should also notice that you must hold the start button in to keep the output energized. We’ll learn how this can be fixed in the second article.

Well, that’s quite a bit of information to get started with, but it should have you talking with and programming your PLC with a simple motor start/stop circuit. In the next article, additional features will be added to the basic start/stop circuit and a slightly more advanced project will be introduced. NV

(/»

b

166

I

i

Our Highly Effective Advanced-Placement Program for experienced Electronic Technicians grants credit for previous Schooling and Professional Experience, and can greatly reduce the time required to com-plete the program and reach graduation. No residence schooling required for qualified Electronic Technicians. Through our Special Program you can pull all of the loose ends of your electronics background together and earn your B.S.E.E. Degree. Upgrade your status and pay to the engineering level. Advance rapidly! Many finish in 12 months or less! Students and graduates in all 50 states and throughout the world! Established Over 50 Years! Write or call for free Descriptive Literature. (601) 371-1351

COOK'S INSTITUTE

OF ELECTRONICS ENGINEERING

mfnW 4251 CYPRESS DRIVE, JACKSON, MISSISSIPPI 39212 WllE FAX: (601) 371-2619

Visit us TODAY on the World Wide Web at http://ymmeooks.edu

_ . Circle #47 on the Reader Service Card.

74

in

H

Octabot

(7 3/4 diameter, 2 decks)

Scooterbot

(7" diameter, 2 decks)

Tankbot Servo ( 1" length, double decks)

All kits include:

Steel hardware

All construction parts

Premodified R/C servos (56 oz-in)

Rubber wheels (tank uses rubber treads)

Precision-cut pre-drilled expanded PVC plastic bases

Illustrated assembly instructions (3D exploded views)

Additional stackable decks available

Robots for the Rest of Us

WWW.BUDEETRaBaTICS.CaM

FEBRUARY 2005

by Mark Batch

Just For Starters

Basics For Beginners

Just For Starters

Staying Cool

Small oversights can get you into trouble when you’re working with electronics. One factor to consider in every project big or small is ensuring that components do not overheat. Resistors, transistors, and other parts can get dangerously hot, even when you are not dealing with high voltage or lots of power. Basic thermal management is not difficult for most projects. Investing a little thought early on can keep you safe and save a great deal of reworking down the road.

The first step in thermal manage- ment consists of evaluating your circuit for potential trouble spots. Look for components that regulate the power supply like voltage regulators, Zener diodes, or switching transistors. Power regulation circuits are common sources of heat because they pass the full current required by the rest of the system. Simple linear regulators dissipate a quantity of power equal to the product of supply current and input/output voltage differential.

A 5 volt circuit that draws just half an ampere from a 12 volt wall trans- former will require a linear regulator to dissipate 0.5 A x 7 V = 3.5 watts; 3.5 watts dissipated in a confined space with inadequate precautions can quickly lead to a meltdown or worse. It is important to understand how much current your circuit draws from each voltage rail and what the power dissipation impact will be on the voltage regulators in your system.

Other parts of a circuit are candi- dates for heat trouble. Are you switching a load on and off? You may drive a light display. You may drive relays or solenoids to open doors or close valves. The switching components which often include transistors, diodes, and resistors can fall victim

to heat-induced failure without proper design. High performance digital inte- grated circuits can run very hot. Running a state-of-the-art embedded controller at an internal clock frequen- cy of 100 MHz or more can result in substantial heat dissipation. The high density of modern integrated circuits makes them ideal candidates for shed- ding lots of power in a small volume.

Thermal management or cool- ing — seeks to spread power over a larger volume to reduce the maximum temperature in any one location. Cooling does not prevent your circuit from generating heat; cooling simply redistributes that ther- mal energy to prevent overheating just like your car’s radiator disperses the engine’s heat.

Thermal Analysis

Once you have identified a poten-

tially troublesome heat source, the next step is determining that compo- nent’s operating conditions. What is the maximum power it will dissipate? What is the maximum ambient air temperature that the system will oper- ate in? You must consider the worst case conditions across all variables for a reliable solution. Finally, what is the component’s thermal resistance to ambient air? This is often a trouble- some variable, but one that you have a degree of control over.

Thermal resistance defines the ease with which heat is conducted from a source to the ambient environ- ment. A higher thermal resistance results in more heat build-up. Thermal resistance is often designated by the Greek letter theta 0 and relates power and heat: DT = 0P. 0 is expressed in units of °C/W. The heat relationship tells us that a tempera- ture rise results from a quantity of

The Standard for checking Capacitors in-circuit

Good enough to be the choice of Panasonic, Pioneer, NBC, ABC, Ford, JVC, NASA and thousands of independent service technicians.

Inexpensive enough to pay for itself in just one day’s repairs. At $199, it’s affordable.

And with a 60 day trial period, satisfaction guaranteed or money-back policy, the only thing you can lose is all the time you’re currently spending on trying to repair all those dogs you’ve given up on.

Locate shorted or leaky components or conditions to the exact spot in-circuit

Still cutting up the pcb, and unsoldering every part trying to guess at where the short is?

$199

Your DVM shows the same shorted reading all along the pcb trace. LeakSeeker 82B has the resolution to find the defective component. Touch pads along the trace, and LeakSeeker beeps highest in pitch at the defect’s pad. Now you can locate a shorted part only a quarter of an inch away from a good part. Short can be from 0 to 150 ohms

CapAnalyzer 88A LeakSeeker 82B

Available at your distributor, or call 561-487-6103

Electronic Design Specialists www.eds-inc.com

Circle #63 on the Reader Service Card.

75

FEBRUARY 2005

Just For Starters

power multiplied by the thermal resist- ance through which the power is flowing. If a component is provided with a highly conductive thermal path to the ambient environment, its 0 is low and, consequently, its temperature rise is low for a given power dissipation.

Finding 0 for a given component is usually done by consulting the man- ufacturer’s data sheet. You can devise

an experiment to obtain 0 empirically, but such efforts are rarely necessary.

You can calculate a component’s maximum operating temperature when you know its maximum power dissipa- tion, its thermal resistance to air, and the maximum ambient air temperature: TMAX = TAMBIENT + 0PMAX. If TMAX exceeds the manufacturer’s maximum rated operating temperature

NanoCoreH for best performance and price! 9S12C microcontroller modules starting at $45!

NanoCore12™ Features:

on-board RS232C interface

up to 33 I/O lines, with multi- property programmability

(e.g. direction, pull-up/pull-down, reduced drive, invert polarity, etc.)

up to 8 key wake-up interrupt inputs, with digital filtering

SCI SPI CAN

8-channel 10-bit ADCs

multiple PWM channels

4-channel timers, supporting input capture/output compare, event counting, gated time accumulation, and simple PWM

32K multi-sector Flash 2K RAM

operates up to 48MHz via PLL

www.technologicalarts.com 3.3 V or 5 V operation Toll-free: 1-877-963-8996 advanced CISC architecture

(USA & Canada)

"NanoCorelZ is a trademark of Technological Arts, Inc.

on-chip Serial Monitor

supports BDM debugging

® BASIC Stamp is a registered trademark of Parallax, Inc.

%/%

£j

£

It writes your USB code!

NO Need to be a USB expert!

HIDmaker ($399) - creates ready to compile PC & PIC programs that talk to each other over USB.

Choose your favorite languages!

PIC: Pic Basic Pro, CG C, Hi-Tech C, MPASM. PC: VB6, Delphi, C++ Builder. Single chip solution: PIC with built- in USB

HIDmaker Test Suite ($149)

USBWatch - shows your device's USB traffic, even during 'enumera- tion', without expensive equipment.

AnyHID - Test any USB HID device. See what data it sends, even what the data is used for.

/ 1

Trace

SYSTEMS, Inc!

301-262-0300

WWW.TraceSystemsInc.com

76

... “Houston, we have a problem!”

Cooling a Hot Problem

So what can you do when you run the numbers and TMAX is too high? It is always nice to have the luxury of redesigning a circuit for lower power dissipation. However, redesign is not always possible or practical. It would also be nice to lower TAMBIENT by only operating your system in Arctic temperatures. Again, this is not always practical. Generally speaking, you must find a way to reduce thermal resistance.

Two common methods of reducing thermal resistance are increasing airflow over the hot component and introducing a heatsink of some form into the system. When you place a fan near a hot component, the increased air flow results in more molecules of cooler ambient air passing over the heat source in a given time interval. There is more contact between hot and cold, resulting in a lower thermal resistance. You can observe this behavior at work in your computer, which has a fan in the AC power supply and probably has another fan positioned close to the CPU.

Metal is a far better heat conductor than air. Copper and aluminum are commonly used to fashion efficient heatsinks. Aluminum is the preferred material because it is less expensive than copper. You will find copper heatsinks in leading edge circuits where the heat problem is so severe that copper’s higher cost is justified.

The basic purpose of a heatsink is to efficiently conduct heat away from a dense source and spread that heat over a much larger area, where it can be properly carried away by the ambient air. A fan’s presence increases the effect of a heatsink because the moving air more rapidly conducts heat carried by the heatsink.

The overall thermal resistance from the hot component to the air is what matters in our analysis. This total resistance is the sum of all the heat conductors and their interfaces. The

FEBRUARY 2005

Just For Starters

CPU in your computer has a certain thermal resistance between the silicon and the CPU package. There is a ther- mal resistance between the package and the heatsink. There is also a ther- mal resistance between the heatsink and the moving air. Summing all of these resistances gives the total 0.

Comprehensive thermal analysis is worth further investigation. There are numerous sources of data on the web and in print.

A Hot Voltage Regulator

Returning to our original example, suppose we are dealing with a 5 V linear regulator such as the LM7805 which is called upon to dissipate 3.5 W. The LM7805 is commonly avail- able in a TO-220 package, which has good thermal properties for its small size: a thermal resistance to air of 65 °C/W. Let’s do the math, neglecting

ambient air for now: DT = 0P = 65 °C/W x 3.5 W = 227.5 °C. Ouch! We could briefly boil water before melting the solder and perhaps starting a fire. Something must be done.

Fortunately, the TO-220 is designed to accept a heatsink and many standard off-the-shelf heatsinks are readily available. The TO-220’s thermal resistance to its package is just 2.5 °C/W. You can observe how most of the resistance is due to poor heat transfer in air. Off-the-shelf heatsinks for TO-220 packages can be found with thermal resistances under 3 °C/W in still air. That yields an overall 0 of approximately 2.5 °C/W + 3 °C/W = 5.5 °C/W. The tem- perature rise is looking much better now: DT = 0P = 5.5 °C/W x 3.5 W = 19.25 °C. If the regulator’s maximum operating temperature is 80 °C, the device can now operate up to 80 °C - 19.25 °C = 60.75 °C. This exceeds the vast majority of requirements.

Stay Cool

You should always examine your circuit before building it to ensure that it will operate safely. This includes proper thermal management. The worst consequences of inadequate cooling include damage, fire, and serious injury. Even if a circuit does not cause immediate damage or injury, heat is a silent killer of elec- tronics. Heat exposure over time shortens the life of your components. A cooler circuit will last longer than its comparable, hotter counterpart and improve safety. NV

About the Author

Mark Balch is the author of Complete Digital Design and works in the Silicon Valley high-tech industry. He can be reached via Email at mark@complete digitaldesign.com

APSC. 2005

March 6—10, 2005

Austin Hilton Austin, TX

The Premier Global Event In Power Electronics

i Plenary with Industry Executives sharing their vision of the future i 329 Presentations from 28 Countries i 14 In-depth Professional Education Seminars i 1 50 Vendor Exhibition Booths i Catered Reception with Exhibitors i 1 2 Exhibitor Seminars i 3 Lively, Informal Rap Sessions i 1 9th Annual Micro Mouse Contest

Networking Events throughout the Conference

Keep checking

www.apec-conf.org

for updates!

software, please visit our website at www.pulsar.gs/nwc

PULSAR, 1947 Sandalwood Place, Clearwater FL 33760-1713 E-mail: mail@pulsar.gs Order line: (727) 524-1500 Technical support: (727) 524-8822 Fax: (727) 524-1225

State-of-the-art software for designing and simulating electronic circuits. 4 **

Home edition only $49.99.

HigfrlyTnnovative PCB designer for creating^mgie and -J ^

double-sided boards. 7** J

Home edition only $49.99.

Circle #70 on the Reader Service Card.

77

FEBRUARY 2005

Selected Titles for the Electronics Hobbyist and Technician—

The Nuts & Volts Hobbyist Bookstore

Don't miss the special on all books by Nyke Predko •••

Handbook of Microcontrollers

by Myke Predko

A straight-talking guide to all the most common eight-bit microcontrollers now in use, TAB Electronics Microcontroller Handbook , edited by Myke Predko, tells you everything you need to know about the Intel 805 1 , Motorola 68HC05, Microchip PIC,Atmel AVR, and Parallax Stamp MCUs. Complete with applications and recom- mendations — from automotive parts and personal computers to household appliances and toys this authoritative tool shows how each MCU works and interfaces with peripheral devices, explains features, architecture, and the instruction set for the built-in processor, and serves up example applications plus all the data necessary to develop them. $79.9$

Programming & Customizing the 805 I Microcontrollers

by Myke Predko

For work or fun projects, exercises, and insights on the world's most popular microcontroller. Over 30 experiments and 1 3 complete projects demonstrate the 805 1 ’s capabilities.The CD-ROM gives you all the software you need to begin developing 8051 applications.This tutorial/disk package is unique in providing you with a complete understanding of the 8051 chip compati- bles, along with all the information needed to design and debug tailor-made applica- tions. Programming & Customizing the 805 1 Microcontroller details the features of the 805 1 and demonstrates how to use these embedded chips to access and control many different devices. $44.95

Robot DNA Series: Programming Robot Controllers

by Myke Predko

In this innovative addition to the Robot DNA Series, author Myke Predko tells you everything you need for your robot to perform up to specification and expectation and for you to fully understand how robot controllers are programmed using the versatile Microchip PICmicro PICI6F627.

All you need to get started are inexpensive off-the-shelf parts and the “C” program- ming language compiler, included on the CD-ROM. $24.95

PC Interfacing Pocket Reference

by Myke Predko

PC interfacing answers in 60 seconds or less!

The ultimate at-a-glance data finder for PC hardware and software engineers, PC Interfacing Pocket Reference packs everything skilled devel- opers need tradition- al ASCII tables, memory and register addresses, and instruction sets, plus BIOS, MS-DOS, DPMI, and Windows APIs. You also get reference information for the leading PC program- ming languages PC assembly, BASIC, C, and C++ as well as time-saving code snippets to use for developing your own applications. What’s more, you’ll find:

PCimRMCillG

Pocket Reference

m»t imam

C fi

b

£

!<*

s

PICMicro Microcontroller Pocket Reference

by Myke Predko

Device, code, and cir- cuit data on one of the most popular micro- controllers around it’s in your pocket with this guide. You’ll never again get stuck in the World Wide Wait or shuffle through coffee- stained printouts, look- ing for the facts you need. Short on verbiage and long on facts, this is the ideal data tool for the experienced applications designer. $29.95

PICMicro

MICROCONTROLLER

Packet Reference

Key charts, protocols, and data tables

> Get all the facts and reference data

MYKE I' III: II h II

Sample Windows device drivers (.VxDs, .WDMs, and .DLLs)

Hardware addresses and device block dia- grams with connector pinouts

ISA, PCI, and USB bus information, along with Plug and Play and Interrupt and DMA interfacing

Conforms to Intel/Microsoft “PC/9x” baseline specification so you know information is current $59.95

WE ACCEPT VISA, MC, AMEX, and DISCOVER

Prices do not include shipping and may be subject to change.

Ask about our 10% subscriber discount on selected titles.

SUMO BOT Build Your Own Remote-Controlled Programmable Sumo-Bot

by Myke Predko

Here's a fun and affordable way for hobbyists to take their robot building skills to the next level and be part of the hottest new craze in amateur robotics Sumo competition.

Great for ages I4+, the kit comes complete with:

Pre-assembled PCB

Multi-function, dual channel remote control

Robot hardware, including collision-sensing infrared LED and receivers

CD-ROM with programming instructions and file chapters of robot building tips and tricks

A built-in Parallax BASIC Stamp 2 and pro- totyping area allowing hobbyists to create their own robot application without having to purchase additional Parallax products

Powered by four AA batteries (not includ- ed) and featuring a built-in infrared remote control, the Sumo-Bot is pre-programmed with the behavior "built-in" to jumpstart custom applications. $99.95

Programming & Customizing PICMicro Microcontrollers

by Myke Predko

This book is a fully updated and revised compendium of PIC programming information.

Comprehensive coverage of the PICMicros' hard- ware architecture and software schemes will com- plement the host of experiments and projects making this a true "learn as you go" tutorial. New sections on basic elec- tronics and basic programming have been added for less sophisticated users, along with 1 0 new projects and 20 new experi- ments. New pedagogical features have also been added, such as "Programmers Tips" and "Hardware Fast FAQs." The CD-ROM contains all source code presented in the book, software tools designed by Microchip and third party vendors for applications, and the complete data sheets for the PIC family in PDF format. $49.95

78

FEBRUARY 2005

Call 1-800-783-4624 today! Or

order online at www.nutsvolts.com

... Get I ©% off your purchase now through Feb* 28, 2005!

Digital Electronics Demystified

by Myke Predko

Now, anyone can gain a deeper under- standing of digital electronics without formal train- ing, unlimited time, or a genius IQ. In Digital Electronics Demystified , electronics expert and author Myke Predko provides a totally painless way to learn enough digital logic and electronics to build your own projects! With Digital Electronics Demystified, you master the subject one simple step at a time at your own speed. This unique guide offers problems at the end of each chapter and section to pin-point weaknesses and a 100- question final exam to reinforce the entire book. So, if you're looking for an enjoyable route into digital logic and electronics, let Digital Electronics Demystified be your short- cut! $19.95

digital

electronics

1 23 Robotics Experiments for the Evil Genius

by Myke Predko

This book provides 1 23 steps needed to bring out the genius in every basement hobbyist! If you enjoy tinkering in your workshop and have a fascination for robot- ics, you’ll have hours of fun working through the 1 23 experiments found in this innovative proj- ect book. More then just an enjoyable way to spend time, these exciting experiments will also provide a solid grounding in robotics, electronics, and programming.

Each experiment builds on the skills acquired in those before it, so you develop a hands-on, nuts-and-bolts understanding of robotics from the ground up. Don’t miss out on these imaginative experiments that teach the basics! $24*95

ROBOTICS

EXPERimENTS i

-i EVIL GENIUS

»® j

miCROCONTROLlER

EXPERimENTS

-"EVIL

GENIUS

123 PIC Microcontroller Experiments for the Evil Genius

by Myke Predko

Microchip continually updates its product line with more capa- ble and lower cost products. They also provide excellent development tools.

Few books take advantage of all the work done by Microchip. 123 PIC Microcontroller Experiments for the Evil Genius uses the best parts and does not become dependent on one tool type or version to accommodate the widest audience possible. Building on the success of 123 Robotics Experiments for the Evil Genius, as well as the unbelievable sales history of Programming and Customizing the PIC Microcontroller, this book will combine the format of the evil genius title with the following of the microcon- troller audience for a sure-fire hit. $24*95

Check out these other hot titles from the Nuts & Volts Bookstore!

Engineer’s Mini Notebook Collection

by Forrest M. Mims III

Volume I features more than two dozen 555 timer circuits that you can build. $10.95

Volume 2 Study rain, lightning, clouds, sunlight, water, temperature, and much more! $10.95

Volume 3 Learn about important sensors and use them to build cir- cuits and projects. $10.95

FEBRUARY 2005

Volume 4 includes frequently used electronic formulas, tables, circuit symbols, and more! $10.95

Robotics Demystified

by Edwin Wise

There's no easier, faster, or more practical way to learn the really tough subjects. McGraw-Hill's Demystified titles are the most efficient, interest- ingly written brush-ups you can find. Organized as self-teaching guides, they come complete with key points, back- ground information, questions at the end of each chapter, and even final exams.This complete self-teaching guide takes an intro- ductory approach to robotics, guiding read- ers through the essential electronics, mechanics, and programming skills neces- sary to build their own robot. $ 1 9.95

Programming PIC Microcontrollers with PICBASIC

by Chuck Hellebuyck

This comprehensive tutorial assumes no prior experience with PICBASIC. It opens with an introduction to such basic concepts as variables, statements, operators, and structures, followed by a discussion of the two most commonly used PICBASIC compilers.

CNC Robotics

by GeoffWilliams

Written by an accomplished workshop bot designer/builder,

CNC Robotics gives you step-by-step, illustrated directions for designing, constructing, and testing a fully functional CNC robot that saves you 80% of the price of an off-the-shelf bot and can be customized to suit your purposes exactly because you designed it. $34.95

Electronics Demystified

by Stan Gibilisco

Best selling Demystified author and electronics expert Stan Gibilisco has penned the perfect introductory book for consumers, hobbyists, and students alike. Coverage includes topics, such as current and power sup- plies, wireless, digital prin- ciples, measurement and monitoring, trans- ducers and sensors, and more. $19.95

If you don’t see what you need here, check out our online store at www.nutsvolts.com for a complete listing of the titles available.

79

t

INI

c*

nmnm

ITillllimiA'TOIU'Hil-J-lill

sg

|

J

*7 GEOFF WILLIAMS

electronics

The Design Cycle

by Peter Best

Advanced Techniques for Design Engineers

The Design Cycle

Mastering the Art of DSP

%/%

Digital Signal Processing (DSP) is an art that has been applied to most every aspect of our everyday electronic existence. Your stereo’s CD player probably employs DSP technology and, if you own a fancy wireless home tele- phone, it will also most likely call upon the services of DSP.

DSP is what you make it. You may only want to average some incoming signal levels over time or you may want to analyze the frequency spectrum of a signal. DSP tech- niques can be simple or complex. So, rather than attempt to bang out a particular DSP project that may or may not be something you wish to read about, I’ll describe the basic elements of a DSP project and let you fill in the middle of the pudding with your favorite mix of flavors.

As you know, I began this DSP discussion by describing a dsPICDEM demo board from Microchip and I’ll continue to use that piece of hard- ware in this offering. The dsPICDEM 28-Pin Demo Board is an unassuming little board that contains a 28-pin vari- ant of the Microchip dsPIC family of devices. Despite the low pin count, the dsPIC30F2010 contains every- thing you will need to perform some DSP magic of your own. Grab a copy of the dsPIC30F2010 data sheet and follow along as we take a detailed look at one of the most important DSP subsystems that are embedded within the dsPIC30F2010 package.

The dsPIC30F20 1 0

Analog-to-Digital

Converter

80

To be able to perform DSP oper-

ations, you must have an incoming signal to process. That signal, if it is analog in nature, is normally acquired by an analog-to-digital (A/D) converter. Remember, the object is to get as much of the original signal’s information into the DSP engine as possible. To do this, the A/D converter must be fast and accu- rate relative to the incoming signal.

The dsPIC30F2010’s A/D con- verter resolves to 10 bits, which equates to 1,024 steps, including the zero step. That means we can use the dsPIC30F2010’s A/D converter to convert an incoming voltage to a 10-bit digital number. Since the dsPIC30F2010’s A/D converter is rated at a maximum of 500 ksps (kilosamples per second), we can do our voltage level collecting very quickly, depending on how fast we run the dsPIC30F2010 CPU.

Just in case more than one voltage source needs to be sampled, the dsPIC30F2010’s A/D converter multiplexes six input channels into four sample and hold amplifiers. The sample and hold amplifiers do just what their name implies; they sam- ple the incoming input signal and hold that value for use by the A/D converter circuitry behind them.

Think of the sample and hold amplifiers as analog output channels (CHO, CHI, CH2, CH3) with multi- plexed inputs (AN0, AN1, AN2, AN3, AN4, AN5). One, two, or four of the dsPIC30F2010’s sample and hold amplifiers can be enabled to acquire the incoming data. This allows differing sets of analog inputs to be selected and scanned. For instance, input AN0 can be switched into CHO or CHI. However, CHI can only take

input from AN0 and AN3, while CHO is capable of accepting analog input from all six analog input pins. Regardless of the origin of the ana- log input, the digital A/D converter results are stored in locations 0x00 through OxOF in the 16-word result buffer ADCBCJF which is addressed ADCBCJF0 through ADCBCJFF.

Configure the Analog I/O

Let’s explore the dsPIC30F2010’s A/D converter by configuring it and reading some input voltages. The first step in the dsPIC30F2010 A/D converter configuration process is to identify and set up the analog input pins by setting up the ADPCFG register. The dsPIC30F2010’s ADPCFG register is 16-bits wide, but only uses the lower six bits, as six input pins are all we have for analog inputs. Writing a “0” (zero) to a bit position in the ADPCFG register reverts the corresponding input pin to analog input mode. A “1” written to a bit position in the ADPCFG register forces the I/O pin to the digital mode.

Since we’re only interested in analog input at this juncture, let’s fill our ADPCFG register’s lower six bits with zeroes and enable all of the analog inputs on PORTB. We will also need to set the TRISB register to 0x3F, which directs RB0 through RB5 to turn off their port I/O drivers and work as input pins. Failing to correctly TRIS the PORTB analog inputs and input pins forces the A/D converter to read the level on the pin’s output driver instead of the incoming analog voltage.

FEBRUARY 2005

The Design Cycle

Establish the A/D Converter Voltage Reference

Now that we’ve designated the analog inputs, the next step is to establish a voltage reference for the A/D converter. The dsPIC30F2010 has pro- visions for both positive and negative A/D converter reference inputs. Let’s keep our implementation simple and use the PIC’s voltage rails as the upper and lower limits of our measurements.

The dsPIC30F2010’s AVDD and AVSS pins are connected to a filtered +5 VDC voltage source, which is native to the dsPICDEM 28 Pin Demo Board. This +5 VDC powering of the AVDD and AVSS pins places the dsPIC30F2010’s A/D converter meas- urement limits equal to the voltage rails (0 and +5 VDC) of the dsPIC30F2010. To associate our physical voltage limits to the dsPIC30F2010 A/D converter circuitry, we must also zero the VCFG (Voltage Reference Configuration) bits, which are the three most significant bits of the ADCON2 register.

Now, the physical voltage reference matches the voltage reference config- uration register definition. By setting the rest of the ADCON2 configuration register bits to zero, we choose to only convert inputs muxed to CHO and to not scan a series of analog input pins. We haven’t talked about analog input scanning. In a nutshell, the dsPIC30F2010 A/D converter has the capability of scanning a set of analog input pins automatically. We’ll get a simple conversion process going first and then look at how to make the A/D converter scan.

Clocking the A/D Converter

Although we know that the dsPIC30F2010 A/D converter zooms, it still has its limits. It takes time to sample and then convert the sample. This sample and conversion timing is controlled by the analog module clock and is measured in a number of clock periods designated as TAD.

A TAD is defined as one analog

module conversion clock period. A single dsPIC30F2010 A/D conversion requires a minimum of 12 TAD peri- ods. We can choose to get our analog clock periods from an internal RC oscillator from the instruction clock. The minimum TAD time required for a successful A/D conversion is 154 nS. We control TAD timing using the lower six bits (ADCS) of the ADCON3 register. Here’s how we determine the correct ADCS value:

ADCS = 2 * (TAD / TCY) - 1 = 8.0832896

Where: TCY = 1 / instruction clock = 1 / (4* 7.3728 MHz) = 34 nS TAD = 154 nS Instruction clock is in XT 4x PLL mode.

We can’t designate a fractional ADCS value. So, we can round our ADCS value to 8. Checking our work

Listing 1

# include <string.h> #include <stdio.h>

#include "delay. h"

CONFIG (F0SC,P0SC & XTPLL4 & CLKSWDIS & FSCMDIS) ;

CONFIG ( FWDT , WDTDI S ) ; CONFIG (FB0RP0R,PWRT1 6 <

& MCLREN & BORDIS) ;

CONFIG (FGS,GCPU & GWRU) ;

CONFIG (FCOMM,PGEMU) ;

#define BAUD1 57600

#define 0SC1 7372800

#define DIVIDERl ( ( (OSC1/BAUD1) /16) - 1)

void put char ( char c) ; void putchar( char c)

while (!U1_TRMT) ;

//TRMT is set when TSR is empty

/ / continue ;

U1TXREG = c;

}

//load the register

void main (void) r

1

char x;

U1 ALTIO = 1; U1BRG = DIVIDERl; U1 UARTEN = 1;

U1 UTXEN = 1;

// echo code for demonstrating UART operation

// use HyperTerminal to // as you type them. .

// while (1) {

see the echoed characters

// while ( !U1 URXDA) ;

// while ( !U1 TRMT) ;

// U1TXREG =U1RXREG ;

// }

ADPCFG = 0x0000; TRISB = 0x3 F ; ADC0N2 = 0x0000; ADC0N3 = 0x0009; ADCHS = 0x0000; ADON = 1; while (1)

{

ADIF = 0;

//all PORTB I/O = Analog input

//all PORTB I/O = input

//no scan, CHO only

//170 nS Tad with system clock

//sample AN0

//turn on the ADC

//clear the ADC interrupt flag

ASAM = 0;

//set up for manual conversion trigger

SAMP = 1;

//begin sampling

X = 10; while (--x) ;

//delay for sampling to be performed

SAMP = 0;

//stop sampling and start ADC conversion

while (1ADIF) ;

//wait for ADC conversion to complete

printf("\r Input Value } 1

= %4X " , ADCBUF0 ) ;

81

FEBRUARY 2005

The Design Cycle

using the rounded ADCS value:

TAD = (TCY / 2) * (ADCS +1) = 153 nS

Where: ADCS = 8.0

Doing the “check our work” math for TAD again using the

(O

b

£

!<*

Listing 2

#include <string.h> #include <stdio.h>

#include " delay. h"

CONFIG (F0SC,P0SC & XTPLL4 & CLKSWDIS & FSCMDIS) ;

CONFIG (FWDT,WDTDIS) ; CONFIG (FBORPOR, PWRT16

& MCLREN & BORDIS) ;

CONFIG ( FGS , GCPU & GWRU) ;

CONFIG ( FCOMM , PGEMU) ;

#define BAUD1 57600

#define 0SC1 7372800

#define DIVIDERl ( ( (0SC1/BAUD1) /16) - 1)

void putchar( char c) ; void putchar( char c)

{

while (im TRMT) ;

//TRMT is set when TSR is empty

//continue;

U1TXREG = c;

}

void main (void) {

char x;

//load the register

U1 ALTIO = 1;

U1BRG = DIVIDERl;

U1 UARTEN = 1;

U1 UTXEN = 1;

// echo code for demonstrating UART operation // use HyperTerminal to see the echoed characters

// as you type them. . // while (1) {

// while (!U1 URXDA)

// while (!U1 TRMT) ;

;

// U1TXREG =U1RXREG ;

// }

ADPCFG = 0x0000;

//all PORTB I/O = Analog input

TRISB = 0x3 F;

//all PORTB I/O = input

ADCON1 = 0x0000; ADC0N2 = 0x0404;

//scan,CH0 only, MUX A, scan 2 inputs AN0/AN1

ADCSSL = 0x0003;

//scan AN0 and AN1

ADCON3 = 0x0009; ADON = 1; while (1)

{

ADIF = 0;

//170 nS Tad with system clock //turn on the ADC

//clear the ADC interrupt flag

ASAM = 1;

//set up for scanning conversion trigger

SAMP = 1;

//begin sampling AN0

X = 10; while (--x) ;

//delay for sampling to be performed

SAMP = 0;

//stop sampling and start ADC conversion

X = 10; while (--x) ;

//delay for conversion to be performed

SAMP = 1;

//begin sampling AN1

X = 10; while (--x) ;

//delay for sampling to be performed

SAMP = 0;

//stop sampling and start ADC conversion

x = 10; while (--x) ;

//delay for conversion to be performed

while(! ADIF) ;

//wait for last ADC conversion to complete

printf ( "\r\n Input Value AN0 = %4X" ,ADCBUF0) ; printf ( "\r\n Input Value AN1 = %4X" ,ADCBUF1) ;

82

entire original computed ADCS value (8.0832896) does provide the expected answer of 1 54 nS. However, since we can’t include the fractional value of ADCS, we can meet our minimal TAD figure by simply upping the computed ADCS value to 9, which yields a TAD of 170 nS.

Define the Active Analog Input Pins

Up to this point, we have selected our analog input pins, specified the A/D converter reference, and identified and configured the A/D converter clock source. The next step is to choose which analog input or inputs to sample. This is accomplished by setting up the ADCHS register. The upper byte of the ADCHS register is dedicated to what is termed MUX B, while the lower byte of the ADCHS register represents MUX A.

Put simply, a MUX is a defined set of pins you desire to sample. The movement between the pins set in MUX A versus the pins selected in MUX B is determined by the ALTS bit, which is bit 0 of ADCON2. Since the least significant bit of ADCON2 is cleared in our application, our code will operate on analog input pins defined in the MUX A area of the ADCHS register. The four least signif- icant bits of the ADCHS register determine which analog input pin is selected for sampling. Thus, a value of 0x0000 for ADCHS will set up MUX A with analog input AN0 on CH0 as our sample input. A value of 0x0001 selects AN1 on CH0 and so forth. Believe it or not, the configura- tion is finished and we’re ready to power up the dsPIC30F2010’s A/D converter and read some voltages.

Power Up and Test the Code

Listing 1 is a culmination of what we have discussed thus far. For those of you who may have missed the first installment of DSP theory in the December 2004 issue of Nuts & Volts, I’ll quickly explain the UART code you

FEBRUARY 2005

The Design Cycle

see at the beginning of Listing 1.

If you continue to follow “Design Cycle,” you’ll notice that I always like to establish a baseline serial interface. Once you get the serial port of that microcontroller working, other things just seem to fall into place a little easier. Recall that I modified my dsPICDEM 28-Pin Demo Board to allow me to use the alternate dsPIC30F2010 serial port so I could eliminate the need to move jumpers to enter and exit debug/ program mode with the MPLAB ICD2.

The Ul_ALTIO = 1 statement tells the dsPIC30F2010 to use the alternate GSART signal pins. The dsPIC30F2010’s UART is enabled by setting the most significant bit of the (J1MODE register (G1_GARTEN = 1). The dsPIC30F2010’s UART baud rate can then be calculated with the fol- lowing formula:

Baud Rate = Fey / (16* (BRG+1))

Where: Fey = Instruction Clock Rate BRG = Value to load into G 1 BRG for baud rate clock generation

The DIVIDER 1 macro statement in Listing 1 solves for the correct BRG value. The baud rate generator value generated by the DIVIDER 1 macro is then loaded into the G1BRG register using the statement G1BRG = DIVIDER 1. Once the baud rate genera- tor is loaded and the GART is enabled, the GART transmitter is switched on by setting the GTXEN bit in the G1STA register (G1JJTXEN = 1).

The commented-out code between the while(l) braces in Listing 1 is a sim- ple serial echo mechanism. The dsPIC30F2010 GART has its own four- byte receive and transmit buffer. When a character enters the receive buffer, the GRXDA bit is set. If there is no transmission in progress, the TRMT bit will be clear. The little echo code snip- pet waits for a character to enter the receive buffer and, when all is clear on the transmit side, it moves the incoming character from the receive buffer into the transmit buffer for transmission. If you wish to run the echo code, simply

FEBRUARY 2005

remove the comment slashes.

Okay, back to the dsPIC30F2010’s A/D converter. As you can see in Listing 1 , all of the A/D converter set-up is performed just before turning on the A/D converter module. Once a conversion is complete, the A/D con- version interrupt flag, ADIF, is set. We’ll poll the ADIF flag to determine when the current A/D conversion has com-

pleted. We could also poll the A/D con- version DONE bit in a similar manner to the ADIF flag bit with the same results. The ASAM bit is cleared to indi- cate to the A/D converter module that the setting of the SAMP bit (bit 1 of ADCON1) will be the signal to begin sampling the selected analog input pin.

After setting the SAMP bit, some time must be given to the sampling

8-16-bit EEPROM | Serial EEPROM | FLASH EPROM | GAL / PALCE | Most MCU's | Low Voltages to 1 .3V. | DIL dev. w/o Adapter.

One Small Programmer handles 5,500 devices. Introducing the diminutive GALEP-4

microcontrollers such as 87/89xxx, PIC, AVR, ST62, etc. Low voltage devices down to 1.3V. No adapter required for DIL devices. 8 Hrs. operation on battery (AC charger included). Runs WIN 98, NT, ME, 2000/XP with Hex/Fuse Editor.

Remote control from other apps, (e.g. Visual Basic). Substitutes high priced universal programmers e.g. ALL-11 (HILO) or LAB-TOOL-48 (ADVANTECH) Providing virtually matching perfor- mance at only 1/3- 1/5 the price.

Info, orders, softwr : 619-702-4420

Conitec's last generation Galep-4 employs ASIC universal pin tech-

SMALL PACKAGE. BIG FEATURES.

Device Programmers Since 1985

nology for each pin of 40 pin ZIF- socket. 6100+device library /life- time free updates. Programs 8/16 bit EPROM'S, E EPROM's, 0-Pwr RAM, FLASH, Serial EEPROM's, GAL, PALCE,

SALES, SUPPORT, INFO / (EMAIL) C0NTACT@C0NITEC.NET - (URL) WWW.C0NITEC.NET. TEL: 619-702-4420. FAX: 619-702-4419

Circle #86 on the Reader Service Card.

Circle #99 on the Reader Service Card.

83

The Design Cycle

process. Once the input signal is sam- pled, clearing of the SAMP bit starts the A/D conversion process. When the ADIF flag signals the end of the conversion, read the digital result from the ADCBGFO register and display it as a hex value via the dsPICDEM 28-Pin Demo Board’s serial port and a HyperTerminal 56K asynchronous terminal session. This sample/hold/con- vert/display process runs until you reset or power off the dsPIC30F2010.

Scanning Multiple Analog Inputs

I briefly mentioned scanning ear- lier and promised to show you how it is done. Take a look at Listing 2. It’s basically the same code we used to harvest a voltage from ANO. The only configuration changes that I had to make involve ADCON2 and the addi- tion of ADCSSL. In the upper byte of ADCON2, I switched on the CSCNA

bit (0x04XX), which turns on the scan input function. The lower byte of ADCON2 sets a bit pattern inside the SMPI (Sample/Convert Sequences Per Interrupt) selection bits (0xXX04). The SMPI bit pattern instructs the A/D converter subsys- tem to set the ADIF interrupt flag after two analog inputs have been sampled and converted. By placing a “1” in the 0 and 1 bit positions of the ADCSSL register, I’ve indicated that I wish to scan only ANO and AN1. The only other change to the configura- tion is the setting of the ASAM bit, which is required when scanning.

The rest of the code is really easy to follow. First, I clear the ADIF flag and kick off the sample process for the first analog input pin to be scanned, which is ANO. I wait for a period of time and trigger the A/D conversion of the sampled ANO input. The result of the conversion is stored in ADCBGFO.

The same procedure that was used

to collect the voltage at pin ANO is repeated for analog input AN1 with the AN1 conversion result being stored in ADCBGF1. The ADIF flag is set following the second sample and conversion indicating that the scanning is com- plete. I then can retrieve the results of the two A/D conversions and display them via the dsPIC30F2010 serial port.

End of Conversion

Getting an accurate representation of the analog data you wish to process using DSP concepts is essential. Now that you have a grasp of the basic operations associated with the dsPIC30F2010’s A/D converter, you can take the first step in creating your own DSP application. If you study the dsPIC30F2010 data sheet and the companion dsPIC30F Family Reference Manual carefully, you’ll find a multitude of ways to deploy the dsPIC30F2010’s powerful A/D converter. NV

Seetron Serial LCDs

Interface a sharp LCD display to your BASIC Stamp® or other micro-controller project with ease. No-solder wiring harnesses and easy mounting kits available too. See www.seetron.com today.

3.2 x 1.4 in. supertwist LCD $45 2400/9600 baud serial BPI'2161

Low (~2mA) current draw Great with BASIC Stamps®

3.2 x 2 in. backlit LCD $49

1200-9600 baud serial ILM’2161

Advanced protocol, 4 switch inputs EEPROM for configuration settings Favorite for OEM applications

3.2 x 1.4 in. graphics LCD 1?n, 2400/9600 baud serial Font and 15 screens in EEPROM Easily draw points, lines, screens

%/%

b

p

3 x 2 in. supertwist LCD $119

1200-9600 baud serial ™'425L

ESD-protected, 4x4 keypad input Store up to 95 screens in EEPROM

i<*

a

iP

Scott Edwards Electronics, Inc.

1 939 S. Frontage Rd. #F, Sierra Vista, AZ 85635 More displays available, phone 520-459-4802 fex 520-459-0623 including bright VFDs.

www.seetron.com sales@seetron.com

See www.5eetron.com

84

Circle #100 on the Reader Service Card.

LabJack

U12

Available now for only ...

$1 1 9 qty 1

($99 qty 10+)

USB Data Acquisition & Control

* Built-in screw terminals

* Easy-to-use USB

* Everything included

* Use with C, VB, LabVIEW, etc.

* Windows 98SE/ME/2000/XP

* 12-bit analog inputs (8)

* 10-bit analog outputs (2)

* 20 digital I/O

* 32-bit counter

Made in Colorado, USA, by LabJack Corp. info@labjack.com, (303) 942-0228

www.labjac

FEBRUARY 2005

by Louis E. Frenzel

Open Communication

The Latest in Networking and Wireless Technologies

Open Communication

Back to the Bands Part 2

In the December issue, I described how I was getting back into ham radio after a long hiatus by building some kits. The kits I chose are made by Ramsey Electronics of Victor, NY. They are very low in cost and simple, even for a beginner. I built the HR30 receiver kit first to get familiar with the 30 meter band before launching back into the hobby. The receiver is a simple, direct conversion type and works very well with its varactor tuning.

Refer back to the December issue for all of the details. In this article, I will describe my experi- ence with the QRF30 transmitter and the QAMP30 optional power amplifier.

The Transmitter

The QRF 30 is designed for the 30 meter ham band that covers 10.1 to 10.15 MHz. That is only 50 kHz wide, but it’s enough for ham CW work. The transmitter is a QRP (low power) design that has a maximum output of about 1 watt. It doesn’t sound like much, but it truly is amaz- ing what you can do with low power if you have a good antenna and reasonably good conditions, as well as some patience.

The basic circuit is shown in Figure 1. Q1 is just a basic crystal oscillator of the Colpitts type. It has provisions for two crystals. The one I got was for 10.108 MHz, just inside the low end of the band. A push- button switch selects between the two crystals. I did not invest in another crystal, as I did okay with the one I had.

Besides, the circuit provides a

pair of varactor diodes that can be used to “pull” the crystal frequency over a narrow range. Why don’t you take a look at the circuit in Figure 1 with diodes D3 and D4. A 10K pot, Rl, varies the DC bias to change the varactor capacitance that, in turn, gives about a 5 kHz variable frequency range around the crystal frequency.

The oscillator output is fed to an intermediate buffer driver amplifier, Q2. This amplifier isolates the crystal oscillator from the final amplifier to prevent frequency variations. It provides sufficient output to drive the final amplifier, Q3. The final stage is a class C amplifier. Its collector output drives a Butterworth low pass filter made up of Cl 7, L6, and Cl 8. This filter matches the transistor output

impedance to the 50 ohm output impedance for the antenna. It also serves to greatly reduce any har- monics generated in the class C amplifier. Using a 12 volt power supply, you should get about 1/2 watt output. The output will go to about 1 watt with a 1 5 volt supply.

Looking at Figure 1, note the circuit at the top using transistor Q4. This PNP is used as a switch to turn the DC supply off and on in accordance with the state of the external telegraph key connected to jack, J3.

With the key up, there is no bias on Q4, so it is off and the transmitter does not get any power. When you press the key down, Q4 gets forward bias and conducts heavily, applying the full 12 volt supply to the crystal oscillator and the bias resistor, R8, for

85

FEBRUARY 2005

Open Communication

the driver stage. The oscillator signal is then amplified and appears at the antenna jack, Jl.

As the transmitter is keyed, it also automatically operates the transmit/receive (T/R) circuit at the transmitter output. It consists of diodes D1 and D2 and their related components. When the transmitter is not keyed, D2 is biased on by the voltage through R13. The voltage on the cathode of D2 keeps D1 cut off.

At this time, the signal from the antenna passes through the low pass filter, CIO, D2, and Cl 9 to the receiver. When the key is pressed down, 12 volts are applied to D1 through L4, turning it on. The voltage at the cathode of D1 reverse biases D2, so none of the transmitter signal gets through to the receiver. The class C amplifier output passes through D1 to the low pass filter and the antenna.

Testing the Transmitter

You will need a power supply, a key, and some kind of dummy load. If you have a receiver that would help, too, as you will be able to actually hear the signal, which is always a good test.

As for a power supply, you need at least 12 volts DC at 500 mA, minimum, for a 1/2 watt output. A supply of 1 5 volts will get you to the 1 watt output level. Any well filtered and regulated supply can be used.

If you do not have a supply, you can actually use eight D cells in series to give you 12 volts. Using 10 D cells will give you the 15 volts needed for maximum output. They certainly have the capacity to supply the current for many hours of operation.

You can also use one of those wall plug transformer supplies that are so common on battery chargers. Be sure to get one with 1 2 or 15 volts and at least a 500 mA rating or, better still, 1 ampere. My experience is that these are not too well filtered and certainly are not regulated, but they are convenient. You can also build yourself a supply from scratch or buy one of the many kits available.

While you are at it, get a 2.5 mm power plug that comes with the wall transformer supplies, as that is what is used for the DC input on the transmitter kit. I had to go buy one to connect my supply an old Heathkit supply I used to use on a two-meter transceiver

sometime back.

As for a key, I had an old standard telegraph key that I have used for decades. It is still in great shape and, after I cleaned it up, it looks like new. They don’t build them like they used to. I do have an old Heathkit keyer somewhere and I will probably use that once I find it and get some practice with the code again.

If you read my receiver article in the December 2004 issue, you know how I feel about the coax connectors used on these kits. All of the inputs and outputs use RCA phono jacks.

Continuing my rant here, I hate these things. If you didn’t know, these things were invented back in the 1930s by RCA for connecting record players to radios and/or amplifiers. Yes, they were made for audio, not RF. However, they do work on RF and video. Most audio and video connections in stereos and TV sets are still using RCA connectors.

Anyway, for RF, the regular UHF SO-239 jack and PL-259 plug are better, although more expensive. They are also a bit easier to work with than the RCA connectors. They give a better match to the coax and have lower loss.

Yet, they do take up more space and cost more. On the other hand, they are a better fit when using test equipment and cables in ham work.

In any case, I spent more time fussing with the cables and connectors than I did in building all the rest of the kit. Bummer. Mike Leo at Ramsey said they were aware of this deficiency and hoped to correct it in the future.

Believe me, Mike, most of us would pay a few bucks extra just for this. I took the easy way out by buying coax adapters from All Electronics to convert PL-259s to the phono jacks. They were a bit expensive, but well worth the cost. If you have ever spent time putting connectors on coax, you know it is.

FEBRUARY 2005

Open Communication

www.lynxmotion.com

By the way, while you are messing with the antenna coax connections, make a phono plug cable for your key, as well. Ugh ... Okay, enough of that harangue.

As for the dummy load, Ramsey recommends a light bulb. A standard PR-4 or type 234 will do the job. Mount it in a socket, attach a connector to it, and connect it to the transmitter output. If the transmitter is working, the bulb will light quite brightly. If you burn out the bulb during testing, you can be happy that the unit is probably working very well.

A more accurate load can be made with some common resistors. For example, solder two 1 watt, 100 ohm resistors in parallel for a 50 ohm, 2 watt load or just use a single 51 ohm, 2 watt resistor. Any other combination of resistors can be used, as long as you get close to 50 ohms and at least 2 watts. I had two 100 ohm resistors, so that is what I used.

I also have an inexpensive SWR power meter that is an even better indicator of output and of SWR. This is the MFJ-816. It has both 30 and 300 watt output ranges. With only 1 watt to work with, it is not very accurate. It does much better with higher power, but I did use it here as a general indicator. I connected the transmitter output to the power meter and the dummy load on the power meter output.

The bottom line here is that the transmitter did work. It does not require any tuning as such, so you are ready to go if it works.

The acid test is to get on the air and make some contacts. I connected my 46 foot dipole to the transmitter and got on the air. I must admit, I am really slow with the CW. I have an extra class license and could in the past easily do the 20 WPM required for that ticket. Slowly, I am getting it back. Like anything else, it takes practice. I connected with hams in New Jersey and Washington state not bad for 1/2 watt from Austin, TX.

Building the Power Amplifier

If you are just not satisfied with 1 watt of power or less, you can get Ramsey’s QAMP30 a 10-20 watt power amplifier that can be driven by the QRP30 transmitter. The circuit is shown in Figure 2. This transmitter uses a pair of enhancement mode MOSFETs in a push-pull circuit. It is a broadband (untuned) design that can be used over a wide frequency range.

In case you haven’t noticed, MOSFETs are taking over the world. Over 90% of all semiconductors made today are MOSFETs, integrated or discrete. They are easier to work with than bipolars and have higher input impedances. You can buy power RF MOSFETs that are good for powers of up to 300 watts or so. These devices have essentially replaced bipolars in most RF (and audio) power amp applications these days.

The 1 watt signal from the QRP30 transmitter comes in through J2 and passes through relay K1 and is applied to the primary of trans- former, T2. This transformer matches the 50 transmitter output impedance of the QRP30 to the input imped- ances of the MOSFETs while also providing 180 degree out-of-phase signals to the MOSFET gates. The power MOSFETs operate in push-pull, meaning that on the positive half cycle of the input, Q1 conducts while Q2 is cut off. On the negative half cycle of the input, Q2 conducts while Q1 is cut off. The transistors amplify only half of the signal, which is then reassembled in the output transformer, Tl. T1 matches the output impedance of the MOSFETs to 50 ohms for maximum power output. The output goes to a five-pole low pass filter made up of LI, L2, L3, and C4 through C7 and then to Jl. The filter effectively reduces any harmonic output.

This amplifier is pretty linear, therefore it has minimum harmonic distortion to begin with. The

l#l|JUU

Scout

6DOF Biped Walker

HI Extreme

Walker

Robust 3 Servo Walker

H2 Extreme Walker

Performance 1 2 Servo Walker

We have many more unique robot kits. Our robots feature:

Precision Laser-Cut Lexan

Preassembled Electronics

Custom Aluminum Components

Injection Molded Components

Very High Coolness Factor

Toll Free: 866-512-1024 Web: www.lynxmotion.com ,

87

FEBRUARY 2005

Open Communication

MOSFETs are actually biased on a slight amount, making them operate in class AB. This gets rid of any crossover distortion common in push-pull transistor amplifiers. The bias comes from the 6.2 volt zener diode, Dl. It operates from the 12 volt supply. Its output goes to a 5K pot, R4, and through R5 to the center tap on the secondary of T2, and then to the gates of Q1 and Q2. The bias is adjusted to 5 volts during the initial tests.

This amplifier uses an RF oper- ated relay for transmit/receive switching. Looking at Figure 2, you can see the RF coming in from J2. It is applied to a voltage doubling rectifier made up of D2 and D3. The DC created by this circuit biases the Darlington pair Q3 and Q4 on. This does two things.

First, it energizes the coil to relay Kl. Kl’s contacts connect the RF input to T2 and J1 to the

output filter.

Second, it turns on Q5, a switch that energizes the bias circuit turning on the MOSFETs. And, voila, the amplified output appears at Jl. J1 connects to the antenna.

As for the construction, it is pretty easy and not unlike building the QRP30 transmitter. The only tricky part was winding the coils and transformers. The kit comes with three toroid cores and the wire to make LI, L2, and L3. Also supplied are the ferrite cores for Tl, T2, and the wire.

None of this is difficult, but it is a bit time consuming but, hey, remember, this is a kit and it does take time. Consider that part of the fun. As I suggested in my December article, take your time to avoid mistakes that can make your life hell when you go to power up the circuit.

Incidentally, Ramsey does sell some nice enclo- sures for these kits. I did not use them, but if you want to make things look neater these nice boxes come with knobs and the end result is a professional- looking product.

Testing the Power Amplifier

You will need a honking big power supply to power this thing. Get a supply that will give you 12 to 15 volts up to 3 amps. I didn’t fool around with trying to build anything this big, so I just bought a surplus supply.

Also, don’t forget the dummy load. Again, Ramsey sug- gests a light bulb, which does a great

job. A #93 auto bulb is good for about 10 watts of output. Use a #1156 auto bulb for up to 25 watts output. You can also build yourself a dummy load with resistors, as suggested earlier. I used 10 510- ohm, 2 watt resistors in parallel to give me 51 ohms at 20 watts. Be sure NOT to use wire-wound resistors that have too much inductance for RF work. Use regular composition or metal film resistors.

I connected the QRP30 output to the QAMP30 input with a short coax cable with RCA phone plugs on it. This is a 75 ohm cable used for video, but since it is short there were not any SWR problems and I didn’t have to fuss with installing connectors on a 50 coax cable. With 1 watt of drive power from the QRP30 and 12 volts, there is an amplifier current of about 1.5 amps. This is good for about 10 watts output.

I used the bulb dummy load, which worked fine. My MFJ-816 RF power meter read about 8 watts. You can get more output if you go to a 15 volt supply. With 1 watt input power, the output goes to about 12 watts. You need more RF input drive power to get to the 20-25 watt output potential of this amplifier.

Nevertheless, a boost for 1 watt from the QRP30 to 10 watts pro- duces excellent results. It makes it much easier to make contacts so is worth the price.

Checking the output power and SWR with my MFJ-816 power meter, I read an SWR of about 1.6 with my 30 meter dipole. Not bad. Anything less than an SWR of 2:1 is good.

So, now I am back on the air. I forgot how entertaining it could be. My CW speed is picking up. Now I am aching to get on some of the other bands to see what is going on. Eventually, I may break down and buy a big, multiband transceiver. In any case, these Ramsey kits have been fun to build. They have also provided a quick, low cost way to get back to ham radio. NV

Resources

For more information, call or Email these sources for their catalogs.

All Electronics

This is the vendor that had the coax connector adapters.

800-826-5432

www.allelectronics.com

MFJ Enterprises Lots of ham kits of all kinds. 662-323-5869

www.mfjenterprises.com

(/»

b

£

C

Ramsey Electronics Lots of other kits, in addition to the ham radio stuff. 585-924-4560 or 800-446-2295 www.ramseykits.com

Universal Radio

Major reseller of radio equipment and accessories. 800-431-3939

www.universal-radio.com

88

FEBRUARY 2005

by Gerard Fonte

In The Trenches

The Business of Electronics Through Practical Design and Lessons Learned

In The Trenches

A Primer on Quality

uality and quality control are important to the success of any product. Designing and producing a quality product is not acci- dental. In this column, we will examine those factors that are necessary for creating and manufacturing a quality product. We will also briefly touch on the ISO 9000 quality standards.

Definition

Quality, or its lack, means differ- ent things to different people. This is not surprising. People are not all the same. For example, parents think that their children’s music is toneless noise. Children think Mozart “eats dead rats.” We will strictly define quality as “something that meets well-defined, objective standards or specifications.” Of course, these standards and specifications may be easy or hard to achieve. Worse, similar products may have vastly different specifications.

This means that a product that performs poorly may actually have better quality. Here’s how.

Suppose there are two manufac- turers that make stereo amplifiers. One manufacturer specifies 1% distortion. The other specifies 0.001% distortion. It’s clear that the manufacturer of the 1% distortion amplifier has a much easier task in terms of design and pro- duction. It is also clear that it is a “lower quality” amplifier in terms of perform- ance. He should have very little trouble in making a product that consistently meets the 1% distortion specification. Conversely, it’s hard to design and produce an amplifier with 0.001% distortion. This manufacturer is very likely to see many more instances where the product fails to meet that standard of performance. By this measure, it is a “lower quality” amplifier.

The point of this is to show that “quality” has a different meaning from the common use of the word. My

personal preference is to use the term “reliability” instead of quality. It seems to be a better description. However, I doubt that all the quality control depart- ments are going to change their names soon. Therefore, the definition of quality remains, “a product that meets objec- tive standards or specifications.”

Attitude

Arguably, the most important aspect in achieving quality is attitude.

If you have great pride in your work, you will automatically strive for a quality product. You will want to do the best that you can. You will see your product as a reflection of your- self — and no one wants to look bad.

On the other hand, if a company president announces a wage freeze while accepting a huge bonus for increased profits, you may not care much about quality. You may just go through the motions with little concern

(fill in the blank)

Syngress HACKING Books: Crack your console, hack your Palm, brew your own Wi-Fi network

WIRELESS HACKING:

PROJECTS FOR WI-FI ENTHUSIASTS Lee Barken $39.95 US

ISBN: 1-931836-37-X Written by the SoCalFreeNet Wireless Users Group, this book covers 802.1 la/b/g ("Wi-Fi") projects teaching Wi-Fi users how to "mod" and "hack" Wi-Fi access points, network cards, and antennas to create robust Wi-Fi networks.

FEBRUARY 2005

GAME CONSOLE HACKING: XBOX,

PLAYSTATION,

NINTENDO, ATARI, &

GAMEPARK 32 Joe Grand and Albert Yarusso $39.95 US

ISBN: 1-931836-31-0 Covering the consoles of yesterday, right up to the latest machines from Microsoft and Sony, this has something for everyone from beginner hobbyist with no electronics experience to self- proclaimed gadget geek.

Circle #90 on the Reader Service Card.

HARDWARE HACKING HAVE FUN WHILE VOIDING YOUR WARRANTY Joe Grand, Ryan Russell, Kevin D.

Mitnick (Editor)

$39.95 US

ISBN: 1-931836-37-X A recipe book for the consumer electronics addict who consid- ers it fun to reconfigure his PC, PDA, remote, and wireless device to do things they weren't meant to do.

89

GAME CONSOLE HACKING

HARDWARE

HACKING

Have Fun While Voiding Your Warranty

In The Trenches

about the product. This is just human nature. What we see is that businesses that foster good company spirit, respect for employees, and teamwork will generally have an easier time making quality products. We also see that the quest for quality must be initiated and supported by the highest levels in the company. This also means that management actions that would undercut these factors must be avoided (even if this means a smaller bonus for the president). Fundamentally, a happy employee does better quality work than an unhappy one.

Education

Of course, wanting to do some- thing and actually doing it are two dif- ferent things. Education, training, and experience are vital in any successful endeavor. Quality is no exception. Designers must feel comfortable and confident in making their ideas into reality. Production must know the limi- tations of their equipment. Technicians must understand the important aspects of the product. These people must also communicate with each other in order to foresee and avoid problems in any particular area.

Because of the rapid changes in

engineering, this education must be ongoing. Learning must never stop. Like Alice in Wonderland, you have to keep running as fast as you can just to stay in the same place and be com- petitive. And, in order for this learning to be effective, it must be communi- cated to all affected groups in the company. New surface-mount equip- ment in production will be wasted if the designers aren’t aware it exists.

A significant part of education is documentation. Documentation teach- es. No one will deny the vast impact that writing had in the history of the human race. Yet, these same people may think that documentation is for someone else, not them. After all, they designed the system, so they know all about it. Thus, it’s not important. Actually, they’re almost exactly correct.

Documentation really is for someone else. It’s for someone else who doesn’t know as much as the designer, but for that very reason it’s critical information for the new- comer. Designers seem to overlook this point. I’ve heard many engineers complain about the lack of documen- tation when assigned to a new project. Yet, these are often the same people who dismiss documentation as boring and unnecessary.

Product Quality

I have one product that I marvel at every time I use it. It’s my Ford 8N trac- tor. It was built in the early 1950s, so it’s about 50 years old. Since I’ve owned it (about 20 years), it’s been kept outside and fully exposed to the weather. Not only does the tractor still run, it runs well. A few years ago, I bought a new (yes, new!) wiring harness for it for about $25.00. Think about that. They are still making wiring harnesses for a 50-year-old farm tractor!

I suppose everyone has a similar story. I also suppose everyone has horror stories about products that are simply abysmal.

Design for Quality

How do you design a quality prod- uct? Truthfully, it’s not that hard to do. You need a full set of reasonable specifications. (Fantasy, contradictory, and mutually exclusive specifications are not reasonable.) There must be a reasonable amount of time for research and testing. Appropriate tools must be available. The design must match the manufacturing capa- bilities. If this sounds like common sense, it is. Unfortunately, common sense isn’t all that common. Every engineer can provide loads of exam- ples where designers were given vague specifications that were constantly changing, a time frame that was absurd, or tools that were simply not adequate. Production can also give examples of designs that simply can’t be built with the equipment on hand. (Or perhaps with any equipment in existence.)

For the design engineer: Keep everything as simple as possible. The fewer the parts, the fewer the things that can fail. Don’t push components to their limits. Sometimes, you can get increased voltage or current ratings on components with little or no increased expense. (This requires communica- tion with the purchasing department.) Use large traces and spaces on PCBs (printed circuit boards) whenever practical. Don’t use a common and

The Power to Design...

PICs

KITS

CO

b

£

log

8

IP

Development Tools & Kits

Kits for most micros, CPLDs, and more starting at $15...

Universal CPU Board PIC and AVR Kits Programmable Logic Kits SeaBass Basic Compiler (as low as $10!) TTL RS232 Adapters

PC I/O for Basic, C, Java, Linux, and More

PAK Coprocessors

Add powerful features to any microcontroller project. Perfect for use with Basic Stamps! Starting at under $10...

Floating Point & A/D

PWM & Pulse Output

Servo Control

Pulse Input

PS/2 Keyboard or Mouse

Visit us for free tools, tutorials and projects www.awce.com/nv

90

Circle #104 on the Reader Service Card.

FEBRUARY 2005

In The Trenches

inexpensive PCB auto-router.

If it’s a simple board, it should be easy to lay out manually. If it’s a complex board, the auto-router can really mess things up. (A high current switching line routed next to a feedback line will cause problems every time.) Understand the manufacturing process and work with it. Design your product around your personal strengths, as well as your production department’s strengths.

For the production department: Engineering does not deliberately make things difficult for you. The changes in the field of engineering are usually much faster and larger than those in production. This means that production has to learn to adapt quickly to new procedures and techniques. Try to anticipate changes by keeping up-to-date on new developments. This requires effort. Subscribing to trade journals (and actually reading them) is a good thing to do.

Teach the engineering department about what is possible and what isn’t. Often times, they simply don’t know. Every new engineer should have a tour of the production facilities. When new equipment is obtained, engineering should be notified about its capabilities. Let the engineering department be aware of any special strengths that you have. Perhaps they can design the product around that. As you can see, communication is important and cannot be ignored.

For the engineering manager: Understand that quality is a team effort. Use the expertise of your people and respect their judgments. If you ask your engineer how long it will take to develop a new product, believe him. If he says 10 weeks and you reply, “I’ve already told our client (or president) we can have it in four weeks,” you are simply being stupid. That’s strong language, but it’s the truth (and no one else will tell you).

The only truly valuable assets of any company are its people. Not using your assets to their fullest is not a smart thing to do. The result will be quite predictable. Either you will have a poor product that the customer will not be happy with or you will have a product that will be late. In that situation, the customer will also be unhappy. In most instances, both will happen and your reputation will be that of someone who can’t deliver.

As the manager, you must lead by example, not by fiat. Quality is not something that can be added at the end of a product’s design. It is inherent to the people who design and manufacture it (stress people). If there is a need for a four-week design cycle, discuss it with engineering and production. Find out what is realistic. Then discuss it with the client/president. It is very rare that a reasonable compromise cannot be reached. This is called negotiation and it is part of the manager’s job. The result is a quality product, on time, and

PC KEYBOARD EMULATION

Interface Keyboards, Switches, and RS-232 to your PC Keyboard Input

Model KE24

The KE24 is the ultimate in flexibility. Inputs from keypads, switches, or serial data can emulate any of the 1 04 keys from a standard keyboard.

Model KE18

ONLY $44.95

9 x 9 matrix or 1 8 Individual inputs

2.5" x 3.0" size

PS/2 Keyboard Port

The KE18 provides a quick and easy interface to the PS/2 port from your switches and keypads.

r-r|HAGSTROM

JJJ ELECTRONICS, INC.

11 Fiddlers Green, Lansing, NY 14882

VISA

Toll Free: 888-690-9080 Phone: (607) 533-4441 Fax: (607) 533-4443

www.hagstromelectronics.com

ONLY $99.95

PS/2 Keyboard Emulation

Up to 12 x 12 matrix

Programmable

RS-232 Port

Microprocessor

Hands-On Training

The PRIMER Trainer is now New & Improved and even easier to use. The PRIMER is a flexible instructional tool featured in Prentice Hall textbooks and used by colleges and universities around the world. Ruggedly designed to resist wear, the PRIMER supports several different programming languages. A comprehensive Self Instruction Manual and an Applications Manual provides lessons, theory, and sample code for a number of Hands-On lab projects.

Primer Training Kit starting

at $120.00 USD

Application

Projects

Include:

Scan Keypad Input & Write to a Display

Detect Light Levels with a Photocell

Control Motor Speed using Back EMF

Design a Waveform Generator

Measure Temperature

Program EPROMs

Bus Interface an 8255 PPI

Construct a Capacitance Meter

Interface and Control Stepper Motors

Design a DTMF Autodialer / Controller

Programming a Reaction Time Tester

Since 1985

OVER

20

YEARS OF SINGLE BOARD SOLUTIONS

cfilAC. inc.

Phone 618-529-4525 Fax 618-457-0110

2390 EMAC Way, Carbondale, IL 62901

World Wide Web: www.emacinc.com

Circle #38 on the Reader Service Card. ^ j

Circle #150 on the Reader Service Card.

In The Trenches

within budget. Your reputation will become that of someone who gets the job done.

Testing and Calibration

Testing is a major part of quality. It is also an important consideration in design. A good design includes hard- ware and software self-test routines. An extra connector that brings out useful test points is a good idea. Software routines that were originally used for debugging the design can be reused to provide access to the programming. This can make trou- bleshooting much, much easier. Test and calibration notes placed on the PCB silkscreen are also very useful.

It used to be that numerous adjustments were needed for any piece of hardware. Each adjustment required measurements and time. Each adjust- ment could be mal-adjusted and was susceptible to tweaking by the user. Nowadays, this may no longer be necessary. Embedded microprocessors (juPs) are common and many include analog-to-digital converters (A/D). So, instead of calibrating out production variations, the jlxP can compensate for these variations.

If you aren’t doing this already, you should. It makes no sense to waste the capabilities of the juP and increase the production time for cali- bration and testing. Remember: A day or so spent during the design cycle can save a tremendous amount of production testing time. A 5 minute savings for 10,000 units is 833 hours of production labor and that doesn’t include the savings from decreased troubleshooting, if needed.

ISO 9000

ISO 9000 (and its variations 9001, etc.) has been around for about 10 years. It is an international stan- dard for quality management. Note that it is NOT a standard for quality control. The basic premise of ISO 9000 is “if a quality assurance process is correctly established, then good quality should follow.” This is a com- monly accepted idea. The GS military has been using something similar for a long time. For the most part, this approach works (based on informa- tion from Quality Manager’s Complete Guide to ISO 9000 by Clements, 1993, Prentice Hall).

ISO 9000 can have many benefits for a company. This is

especially true for firms that deal with the European Community. ISO 9000 provides a means of conferring credibility by indicating that the company meets an objective standard of quality management.

An interesting point is that ISO 9000 certification is performed by a third party, which is certified by a national body of accreditation. This is not the typical method. For example, if you need MIL-SPEC certification, you get it from the Department of Defense. Federal Communication Commission (FCC) compliance comes directly from the FCC.

With ISO 9000, you hire a “regis- trar” to assess your quality procedures. (The cost starts at about $10,000.00 and can go significantly higher.) However, the registrar does not require a specific set of tests or procedures. Rather, he or she will examine your documented tests and procedures to determine whether they are adequate, providing more flexibility.

We also see that ISO 9000 is a top-down approach. As noted above, it is a management system. This means that management must be involved. In particular, a quality management department (different from quality control) will have to be developed. Being a management department, upper management would also be involved. This is good, though. As we saw before, quality requires teamwork. The whole company should be involved in making quality products.

This tells us a number of things. If you already have a good system in place, reasonable management that encourages quality, and effective team- work and communication between departments, then implementing ISO 9000 should be fairly straightforward. Obviously, if you don’t, then ISO 9000 or any quality standard will be difficult to accomplish.

Quality Through Rules

ISO 9000 has 20 “elements.” Each element requires a detailed

FEBRUARY 2005

Front Panels?

Download the free >Front Panel Designer to design your front panels in minutes

£r~~~

Order your front panels online and receive them just in time

www.frontpanelexpress.com

92

Circle #142 on the Reader Service Card.

In The Trenches

document that states how you man- age that part of the quality process. These elements are: Management Responsibility, Quality System, Contract Review, Design Control, Document Control, Purchasing, Purchaser Supplied Product, Product Identification and Traceability, Process Control, Inspection and Testing, Inspection/Measuring and Test Equipment, Inspection and Test Status, Control of Nonconforming Product, Corrective Action, Handling, Storage, Packaging and Delivery, Quality Records, Internal Quality Audits, Training, Servicing, and Statistical Techniques. Not all of these elements are required for every business.

You can see that a lot of paper- work is involved. You create all the paperwork. Presumably, the departments that are affected by the sections will write those documents. The registrar verifies that the proce- dures in the documents meet the necessary standards and that you actually perform those procedures.

There are three levels of detail. The first documents, or Level I, are brief policy statements. Level II documents are the actual departmental proce- dures. Level III documents confirm that the Level II procedures are actually being followed (like test and calibration results). ISO 9000 is probably too involved for very small companies.

There is certainly a legitimate question here: Do rules create quality or just the appearance of quality? As we noted at the start, the attitude toward quality is important for every- one. A significant aspect of ISO 9000 is that management must make a serious commitment to quality. We also noted that management’s attitude is a critical factor in creating an atmosphere that fosters quality. Therefore, by forcing management to acknowledge and support the ISO 9000 standards, management is forced to provide the tools and materials necessary for quality design and production. This can certainly improve quality.

Of course, it is also possible to try to bypass the procedures after the

registrar leaves. However, this is not easy to do. ISO 9000 is really a bureaucracy. It creates a paper trail that is difficult to conceal or falsify and there isn’t really much point in trying to do so. The registrar makes two unannounced visits each year to verify that all the procedures are being followed. Upper management takes a dim view of middle managers who put the company’s health at risk, especially since ISO 9000 certification can be a very important asset to a company.

Therefore, it is reasonable to believe that rules can improve quality. It doesn’t mean that the quality is the best that’s possible. Nor does it mean that all ISO 9000 certified companies provide the same quality. It does create and foster management’s commitment to quality and that’s certainly a very good thing.

ISO 9000 doesn’t guarantee that quality problems won’t arise. No set of rules can do that, but they do create a framework that can be used to address these problems. For example, it’s harder for a manager to declare a development schedule by whim. The ISO 9000 documents specify what needs to be done. These specifications have already been accepted by the manager. Therefore, the manager can be shown to be violating the ISO 9000 standards with his silly schedule. A more reasonable design timeline can result from using the ISO 9000 standards as a reference.

Conclusion

Quality is a team effort. It requires communication and coordi- nation between departments, as well as a commitment by management. The attitude of every player is impor- tant. It only takes one person or one department to create significant quality problems. The ISO 9000 standard is a management tool that can be used to improve quality perhaps signifi- cantly — by forcing management to take an active role in fostering and supporting a quality atmosphere throughout the company. NV

Amazing Devices

www.amazingl .com

Anti Gravity Projects

All new mini 35 kv 1.5 ma adjustable output power supply with instructions on making a simple craft.

GRAIKKit $69.95

GRA10 Assembled $119.95

Green Lasers Pointers

with Coliminator

1 0,000 feet plus - Full 5 mw. A real beauty!!

LAPNGR5 Ready to use. ..$129.95

30 Inch Spark

Tesla Coil

Light weight table top unit is only 35 lbs with air cooled two point spark gap. For 110 or 220 operation.

I

BTC4K Kit $899.95

BTC40Assmbld $1199.95

BTC3K Kit lOinch spark .. $349.95

Phaser Pain Field Pistol

Experimental device for animal control. Variable and complex output over 130db. Do not point at people! Higher powered and rental units available.

PPP1K Kit $59.95

PPP10 Assembled $84.95

Burning Laser Ray Gun

Uses our sealed C02 laser tube and high efficiency current source to generate a continous beam capable of lighting fires over distances. Operates 12 vdc with optional inverterfor field or 115vacforlab use.

LABURN1 Plans $20.00

(all parts available)

Information Unlimited

Box 716, Amherst, NH 03031 USA Orders: 1-800-221-1705 Fax: 1-603-672-5406 Email: riannini@metro2000.net Catalog $2.00

93

FEBRUARY 2005

Circle #44 on the Reader Service Card.

Nuts & Volts

Tech Forum

Tech Forum

QUESTIONS

I’m trying to find service information or help for a BSR MCD8090 AM/FM Stereo Receiver. This unit was called a "Thunder Thrower" and was purchased from DAK Industries. The FM section is not working.

Any help would be appreciated.

#2051 Mike Uschak

Loyalhanna, PA

I recently purchased a 48 VDC to 12 VDC switching power supply from a surplus place. What are the general rules of thumb for getting this thing to work?

I know switchers need a load, but on which output? It has +3 V, +5 V, -12 V, and +12 V outputs. I am only interested in the +12 @10 A output. This supply has a couple of sensing circuits; what do they usually tie to? The supply house doesn't acknowledge any tech questions they just sell the stuff. The factory made these on a special run and doesn't want to admit that they made the thing. Now, I'm out in left field trying to get it to work.

#2052 Bob Sheetz

Ocala, FL

I'm working on an old Epiphone Electar Zephyr guitar amp. It looks like it’s from the 30s or 40s.

I got the amp working, but I can not get the vibrato to work. The oscillator is very weak. It looks like someone worked on it before me and rewired the vibrato circuit.

I cannot find a schematic for it. Does anyone have one or know how it is wired? The output of the oscillator goes to the grids of the two 6V6s. #2053 Jon Garee

Newark, OH

I need to purchase a good, reliable, and low cost schematic capture/board layout program. Suggestions?

#2054 Aldo Powell

via Internet

I have a bunch of unmarked LEDs. Is there any way to determine the specs (forward voltage) of an LED if you don't already know it?

#2055 Jeff Rocchio

via Internet

This is a READER-TO-READER Column. All questions AND answers will be provided by Nuts & Volts readers and are intended to promote the exchange of ideas and provide assistance for solving problems of a technical nature. All questions submitted are subject to editing and will be published on a space available basis if deemed suitable to the publisher All answers are submitted by readers and NO GUARANTEES WHATSOEVER are made by the publisher The implementation of any answer printed in this column may require varying degrees of technical experience and should only be attempted by qualified individuals. Always use common sense and good judgement!

Send all material to Nuts & Volts Magazine, 430 Princeland Court, Corona, CA 92879, OR fax to (951) 371-3052, OR email to

forum@nutsvolts.com

ANSWER INFO

Include the question number that appears directly below the question you are responding to.

Payment of $25.00 will be sent if your answer is printed. Be sure to include your mailing address if responding by email or we can not send payment.

Your name, city, and state, will be printed in the magazine, unless you notify us otherwise. If you want your email address printed also,

indicate to that effect.

Comments regarding answers printed in this column may be printed in the Reader Feedback section if space allows.

QUESTION INFO

To be considered

All questions should relate to one or more of the following:

1) Circuit Design

2) Electronic Theory

3) Problem Solving

4) Other Similar Topics

Information/Restrictions

No questions will be accepted that offer equipment for sale or equipment wanted to buy.

Selected questions will be printed one time on a space available basis.

Questions may be subject to editing.

Helpful Hints

Be brief but include all pertinent information. If no one knows what you’re asking, you won’t get any response (and we probably won’t print it either).

Write legibly (or type). If we can’t read it, we’ll throw it away.

Include your Name, Address, Phone Number and Email. Only your name, city, and state will be published with the question, but we may need to contact you.

How can I restrict outgoing calls on my land line from one phone?

#2056 Bill Gregory

via Internet

I am looking for a wiring diagram to help me build a cable tester. The cables have between six and 12 wires.

#2057 Nestor Quiroga

via Internet

What circuitry could I use to determine the winner of a Pine Box Derby race? These little cars cross the finish line at very fast speeds and are usually only milliseconds apart. I would like to use infrared or laser beams to be broken by the cars as the trigger for the circuit to determine the winner.

#2058 Bob Sheetz

Ocala, FL

ANSWERS

[10045 - October 2004]

I got a new computer with Windows XP on it. (My old computer had Windows 98.) I use a

94

FEBRUARY 2005

Tech Forum

DOS program to communicate with a PLC (programmable logic controller) through the serial port. The DOS program loads and works , but It will not communicate through the serial port. I’ve tried different settings and the Windows 98 compatibility mode. The program tries to access the PLC, but It times out. If I unplug the serial cable, It gives a communication error.

How do you get the XP serial port to work using older programs? Is there a way to get to a C: \ prompt before XP loads, like in 98? Can the hard drive be partitioned in XP and use 98 for older programs?

The manufacturer of the software does not have an answer, but they want to sell me new software that will run under XP though they removed the features I use the most.

Windows XF behaves very differently from Windows 98 in three crucial ways:

1) Direct control of hardware, such as parallel and serial ports, is blocked! You need a driver called "directio.exe" to allow your program direct access to hardware. Get it at www.directio.com/index.htm ?http&SSw ww.direct-io.com /kb/q 100006.htm or www.power basic.com/files/pub/tools/win32/

2) You cannot boot to the MSDOS C> prompt, since XF is no longer built on MSDOS.

3) The DOS windows from "command. com" and "cmd.exe" are shells running on top of XP.

You could run a dual boot system if you ran the upgrade to XP from Win 98 and placed the system into a separate directory. This doesn’t seem like as good a solution as #1 above.

Barry Cole Sunnyvale, CA

[12046 - December 2004]

Many years ago, I used an IC from Holtek that would play different melodies. It was In a TO-92 package and looked much like a transistor, but Holtek has

discontinued It. Are there any other manufacturers with a similar IC or is there a way to program a microcontroller to serve the same purpose?

Tim Fitzstephens Kalamazoo, Ml

# I There is a greeting card module that plays three Christmas tunes that goes by the part number SGI 4. Here is one link that sells it for under $5.00.

www.web-tronics.com/carmelchrisc

.html

Daryl Rictor via Internet

#2 Yes, there is a microcontroller that can play tunes! It’s called the PICAXE. It’s a PIC controller with a bootstrap program downloaded to it and it uses a PBASIC language that is very similar to the BASIC Stamp. In the command language is a TUNE command that will play music. PICAXE.com has a wealth of information on the processor and how to program it. You will also find over 500 tunes ready to download.

The chip is very versatile, with many commands only found on very expensive controllers. The chip number is PICAXE 08M and the cost is under $4.00. Believe it or not, I have purchased them on eBay. They are available in the states at phanderson.com

B.Ward via Internet

[12047 - December 2004]

/ would like to make a PC keyboard emulator where toggling a switch could emulate everything from an “A” keypress to a “Ctrl+Alt+ Shlft+A.” A schematic would be great, but even a nudge in the right direction is appreciated.

Frank Mozingo via Internet

#1 There are several commercial options available. Here are a couple:

www. 3tronics.com/keyboard_ emulator_price.htm

www.vetra.com/312txt.html

If you want to "do it yourself," you can look at the link below. I designed a PC keyboard decoder that would use a microcontroller to read the scan codes from a PC keyboard and provide the ASCII output. You could reverse this process to generate scan codes from discrete switch closures. www.softcom.net/users/darylr/io /pckbavr.html

Daryl Rictor via Internet

#2 Hagstrom Electronics makes two PC keyboard emulators that may do exactly what you require. More information on these products can be found at www. hagstrom electronics.com. Good luck with your project!

Rick

Oakland, CA

[#1055 -January 2005]

/ have a test set for aligning my ham radio equipment. I have no trouble aligning receivers with this equipment, but when I attach three frequency counters to the output the readings go wild. When I connect them to older signal generators, the responses are as expected. Hooking the test set to my oscilloscope, I see that the signal generator is synthesized, not a pure sign wave, and Is chock full of harmonics.

How can I filter the output sufficiently so a frequency counter can be properly used?

John Ciperano, K4EBC via Internet

Harmonics from the generator should not bother the counter, but ringing of the connecting cable will. It is likely that the older generator put out a sine wave that is less prone to ringing. Try connecting a 50 ohm termination at the counter end of the cable (and use a 50 ohm cable). That should solve the problem.

Russell Kincaid Milford, NH

~ 95

FEBRUARY 2005

Tech Forum

[#1058 -January 2005]

I'm using an LM3909 in a circuit to control flashing red and green lights on a model railroad. Is there a pin-for-pin replacement for it? If not, is there one that isn't pin- for-pin?

R.Thompson Richmond, MO

As you know, the National Semiconductor LM3909 LED pulser has been discontinued, but the NET876 is a direct replacement for the LM3909. The original devices can still be found, but they are getting a little pricey. Use the Froogle option in the Google search engine (www. google.com) to search for the LM3909.

There is a replacement option that utilizes discrete components to synthesize the pulser device. You can find the information at: http:// home.cogeco.ca/ ~ rpaisley4/LM3 909.html

Ronald H. Schafer Cuyahoga Falls OH

[9046 - September 2004]

What happens when an EXE file is run on a PC? I would like to know where the contents of an EXE file will be loaded and so on. Also , I am confused with partitions on the hard disk drive. I would like to know how the partitions (i.e., C, D, etc.) are represented on the disk.

You've asked a couple of very complex questions. Books have devoted entire chapters usually it takes more than one chapter to describe "exactly" what happens when MS-DOS (or Windows) loads an .EXE file.

Just for starters, “where” the %/% contents will be loaded is not ^ constant. Loading will begin at the ^ first available memory location, ^ whatever that happens to be *8 (“whatever” depends on what else is 2 running, the hardware configuration f3 of the machine, and several other ^ factors). In that available space, the

96

system first constructs the program environment, takes chunks from the disk file, and places them into memory.

There are specifications in the disk file that describe how the system should place the data in memory (starting at the lowest available address, the highest available address, etc.), as well as directives that identify pieces of the data that must be modified to reflect where that chunk or other chunks actually end up. Most of the required gyrations can be determined from studying a detailed description of the "MS-DOS executable file format" specifications. The rest can be found in a description of the MS- DOS exec program function call. Microsoft Press has some reasonably good books that cover both subjects.

As for partitions on disk drives, that is also a messy subject although not as messy as program loading. The very beginning of the disk contains some information in fixed places. The first sector of the first track of the first platter contains something called the 'Master Boot Record” or "MBR." Part of the MBR is a block of data that describes the physical characteristics of the entire disk number of heads, number of cylinders, number of sectors-per- track, etc.

Another part known as the fdisk table or partition table allows one to divide the disk into as many as four logical sections or partitions. Each partition is described by where on the disk it begins (i.e., what cylinder, head, and sector) and the total number of sectors (consecutive/ contiguous from the starting point) that are part of that partition. There is also a flag for each partition to indicate what kind of file-system (or other type of use) is specified for that partition.

DOS recognizes two kinds of partitions: primary partitions, which will have a file system created directly for them, and extended partitions, which have another layer of indirection involved. They start with

an extended partition table, which is similar to the primary one, except that it has space for describing eight sections instead of just four. Those descriptions are relative to the beginning of the extended partition, not to the start of the disk. Then, you create the actual file systems on those partitions within a partition section.

Finally, when DOS starts up, it looks for that fixed location information on each physical drive that is attached to the system and assigns drive letters to each primary partition where it finds an appropriate file system. After that, it goes back and checks for any extended partitions and assigns drive letters to each partition in a partition that has an appropriate file system present. Finally, DOS loads any installable drivers (e.g., for CD-ROM, etc.) and assigns any required drive letters for those devices.

I haven't even touched on how data or files are represented in the MS-DOS file system. That's another whole book.

The bad news is that all the above is a superficial explanation of what actually goes on. When you get down to the actual gory details, things are a lot more complicated and complex.

Now, aren't you sorry you asked?

Robert Bonomi Evanston, IL

[10041- October 2004]

/ picked up a Zenith TV model H2017Y from a hotel that was remodeling. I can't get the AV inputs to work; it looks like some programming or set-up is required. I don’t have an owner’s manual and would appreciate any help.

You can call Zenith Data Systems at (800) 227-3360; they'll have service and owner’s manuals. If the set needs to be repaired, go to Howard W. Sams, www. hwsams.com for a service manual.

James Stotler Pleasant Hill, CA

FEBRUARY 2005

Advertiser’s Index

Abacom Technologies 67

ActiveWire, Inc 29

All Electronics Corp 35

Anchor Optical Surplus 15

APEC 2005 77

Atlantic Int’l Institute, Inc 60

Atomic Time 49

AWC 90

Beilin Dynamic Systems, Inc. ..29

Budget Robotics 74

C & S Sales, Inc 55

Circuit Specialists, Inc 98-99

Cleveland Institute of Electronics .41

Command Productions 11

Conitec DataSystems 83

Cook’s Institute 74

Cunard Associates 29

DDS, Inc./BSIO 29

Earth Computer Technologies ..10

Electronic Design Specialists ..75

EMAC, Inc 91

ExpressPCB 19

Front Panel Express LLC 92

Hagstrom Electronics, Inc 91

Halted Specialties Co 3

Hobby Engineering 28

Imagine Tools 51

Information Unlimited 93

Integrated Ideas & Technologies, Inc. 83

Intronics, Inc 29

Jameco 23

Jaycar Electronics 7

LabJack 84

Lemos International Co., Inc 9

Linx Technologies 59

Lynxmotion, Inc 87

Mateo, Inc 29

Maxstream 67

microEngineering Labs 45

Micromint 47

Mouser Electronics 61

Net Media 2

Parallax, Inc Back Cover

PCB123/PCBexpress 5

Pico Technology Ltd. UK 12

PULSAR 77

Pulsar, Inc 29

QKITS 29

R4Systems, Inc 20

RABBIT Semiconductor 17

Ramsey Electronics, Inc. ...42-43

RJL Systems, Inc 40

Rogue Robotics 29

Scott Edwards Electronics, Inc. ..84

Square 1 Electronics 46

Surplus Sales of Nebraska 33

SYNGRESS Publishing 89

Syspec, Inc 50

Technological Arts 76

Trace Systems, Inc 76

Trilogy Design 61

Tritronics, Inc 27

V&V Machinery & Equipment, Inc. ..29

Windsor Distributors 21

XGameStation 29

Zagros Robotics 29

AMATEUR RADIO & TV

Atomic Time 49

Ramsey Electronics, Inc 42-43

Surplus Sales of Nebraska 33

Windsor Distributors 21

BATTERIES/CHARGERS

Cunard Associates 29

BUYING ELECTRONIC SURPLUS

Earth Computer Technologies 10

Jaycar Electronics 7

CCD CAMERAS/VIDEO

Circuit Specialists, Inc 98-99

Mateo, Inc 29

Ramsey Electronics, Inc 42-43

Tritronics, Inc 27

CIRCUIT BOARDS

Cunard Associates 29

ExpressPCB 19

Maxstream 67

Micromint 47

PCB123/PCBexpress 5

Pulsar, Inc 29

R4Systems, Inc 20

V&V Machinery & Equipment, Inc 29

COMPONENTS

Beilin Dynamic Systems, Inc 29

Front Panel Express LLC 92

Jameco 23

Lemos International Co., Inc 9

Linx Technologies 59

Maxstream 67

Micromint 47

PCB1 23/PCBexpress 5

Pulsar, Inc 29

Windsor Distributors 21

COMPUTER

Hardware

ActiveWire, Inc 29

Earth Computer Technologies 10

Hagstrom Electronics, Inc 91

Halted Specialties Co 3

Imagine Tools 51

Surplus Sales of Nebraska 33

Microcontrollers / I/O Boards

Abacom Technologies 67

AWC 90

Conitec DataSystems 83

DDS, Inc./BSIO 29

EMAC, Inc 91

microEngineering Labs 45

Micromint 47

Net Media 2

Parallax, Inc Back Cover

R4Systems, Inc 20

Scott Edwards Electronics, Inc 84

Square 1 Electronics 46

Technological Arts 76

FEBRUARY 2005

Trace Systems, Inc 76

XGameStation 29

Software

PULSAR 77

Trilogy Design 61

DESIGN/ENGINEERING/ REPAIR SERVICES

DDS, Inc./BSIO 29

ExpressPCB 19

Front Panel Express LLC 92

Pulsar, Inc 29

R4Systems, Inc 20

RJL Systems, Inc 40

Trace Systems, Inc 76

V&V Machinery & Equipment, Inc 29

EDUCATION

Atlantic Int’l Institute, Inc 60

Cleveland Institute of Electronics 41

Command Productions 11

Cook’s Institute 74

EMAC, Inc 91

Hobby Engineering 28

RJL Systems, Inc 40

Syspec, Inc 50

XGameStation 29

ENCLOSURES

Integrated Ideas & Technologies, Inc 83

EVENTS

APEC 2005 77

KITS

C & S Sales, Inc 55

Earth Computer Technologies 10

EMAC, Inc 91

Hobby Engineering 28

Imagine Tools 51

Information Unlimited 93

Jaycar Electronics 7

QKITS 29

RABBIT Semiconductor 17

Ramsey Electronics, Inc 42-43

Scott Edwards Electronics, Inc 84

Tritronics, Inc 27

XGameStation 29

LASERS

Information Unlimited 93

MISC./SURPLUS

All Electronics Corp 35

Front Panel Express LLC 92

Halted Specialties Co 3

Surplus Sales of Nebraska 33

Windsor Distributors 21

OPTICS

PROGRAMMERS

Conitec DataSystems 83

Intronics, Inc 29

microEngineering Labs 45

PUBLICATIONS

Mouser Electronics 61

Square 1 Electronics 46

SYNGRESS Publishing 89

RF TRANSMITTERS/ RECEIVERS

Abacom Technologies 67

Linx Technologies 59

Mateo, Inc 29

ROBOTICS

Budget Robotics 74

Hobby Engineering 28

Imagine Tools 51

LabJack 84

Lemos International Co., Inc 9

Lynxmotion, Inc 87

Net Media 2

Rogue Robotics 29

Zagros Robotics 29

SATELLITE

Lemos International Co., Inc 9

SECURITY

Information Unlimited 93

Linx Technologies 59

Mateo, Inc 29

STEPPER MOTORS

Jameco 23

TEST EQUIPMENT

Beilin Dynamic Systems, Inc 29

C & S Sales, Inc 55

Circuit Specialists, Inc 98-99

Conitec DataSystems 83

Electronic Design Specialists 75

Intronics, Inc 29

Jaycar Electronics 7

LabJack 84

Pico Technology Ltd. UK 12

Syspec, Inc 50

Trace Systems, Inc 76

Tritronics, Inc 27

TOOLS

C & S Sales, Inc 55

WIRE/CABLE & CONNECTORS

Anchor Optical Surplus

.15 Jameco

.23

97

CircuitSpecialists.com

CircuitSpecialists.com

CircuitSpecialists.com

/Digital Storage Oscilloscope ModuleN f ESD Safe Thru-HoleX

/Digital Laser TachonSeter

PC based Digital Storage Oscilloscope, 200MHz 5GS/s 1 equiv. sampling USB interface

Details & Software Download at Web Site

> Test Equipment

Convert any PC with USB interface to a high perform- ance Digital Storage Oscilloscope. This is a sophisticated PC basedscope adaptor providing performance com- patible to mid/high level stand alone products costing much more! Comes with two probes.

> Oscilloscopes/Outstanding Prices

Item# 200DSO Only$859.00

Soldering/Desoldering Repairing System

Item# CSI701 rt

jm

$199.00!

High precision thermostatically controlled station w/ 35 W Iron & desolder gun. Built-in double cylinder vacuum pump.

Details at Web Site

> Soldering Equipment & Supplies k > Rework Stations j

($49MT)

•5 digit, 6” LCD Display •2.5-99,999 RPM test range •Auto-Ranging

•2” to 80” test range Item# •memory function D T- 6 2 3 4 C

Details at Web Site

> Test Equipment > Specialty Test Equipment

^T

/Circuit Specialists Soldering Station w/Ceramic Element & Seperate Solder Stand

•Ceramic heating element for more accurate temp control

•Temp control knob in F(392° to 896°) &

C(200° to 489°)

•3 -prong grounded power cord/static safe tip •Seperate heavy duty iron stand •Replaceable iron/easy disconnect jtem#

•Extra tips etc. shown at web site st^TIONI

Rapid Heat Up!

Also Available w/Digital Display & Microprocessor Controller Item#

CSI-STATION2

$49.95

Details at Web Site

SMD Hot Tweezer, Adaptor Fits CSI Stations 1 & 2, ai also CSI906

$29.00

Item# CSITWZ-STATION

> Soldering Equipment & Supplies > Soldering Stations

PC Based Scope Card

See Details on Web Site

'32K samples/Channel memory Includes software and a CD ROM '20Ms/S Sampling rate/Channel 'Scroll mode has sweep times to 1 Hr/Sec 'Voltage and Time Cursors 'Voltage Range: 50mV to 5V, 7 Steps 'Time Range: 50ns/div to 0.5s/div, 1-2-5 22steps ^^Technical Details at Web Site > Test Equipment

A $189.00 Value!

Only

$89.00!

/ Triple Output Bench Power Supply\

with Large LCD Displays Output: 0-30VDC x 2 @ 3 AMPS & lea. fixed output @ 5VDC@3A Source Effect: 5xlO"4=2mV Load Effect: 5xlO-4=2mV Ripple Coefficient:: <250uV Stepped Current: 30mA +/- 1mA

CSI3003X3 S1 79.00 Input Voltage: 110VAC (qty 5+/$169.00) Details at Web Site

> Test Equipment > Power Supplies J

Item# CSI825A++

Microprocessor Controlled !

Includes 4 Nozzles!

FANTASTIC VALUE!!

Onl

$199

l. 00 !

SMD RE-WORK SYSTEM

w/Vacuum Pick-up tool

Details at Web Site

> Soldering Equipment & Supplies > Rework Stations ^

/SMD RE-WORK SYSTEM w/Solder Iron' Item# CSI906

Incredible Deal., only

$169.00!

Includes 4 Nozzles!

Details at Web Site

> Soldering Equipment & Supplies > Rework Stations

hjUf xjii

> Oscilloscopes/Outstanding Prices

/1500W Heat Shrink Gun

With a temperature range of 392°F to 932°F & two power settings, 800W and 1500W, it will shrink tubing effortlessly. A thermo-control rotating knob on the rear of the unit will adjust the temperature electronically for precise con- trol, while the three-way trigger switch adjusts the speeds. Comes complete with a concentra- tor air nozzle and a retractable stand.

Details at Web Site Only $18.95

Item# ZD509

Q9\

P

Protek 100MHz Realtime Scope

Brand New

2 Ch Dual Trace 6” Internal Grid ALTMAG ALTTRIG TV Sync 5 Vertical Modes

i

:

Not Refurbished! Includes / scope probes

Super

Blowout

Price!

Item# 6510

Details at Web Site

A $975.00 Value!

100MHz only $499.00

While Supplies Last!

> Meat Shrink Tubing SoftTube Our Own Brand

/" Dual Output DC Bench Power Supplies

> Test Equipment > Oscilloscopes/Outstanding Prices^

Hot Air Gun w/Digital Display for SMD’s

Now, precise temperature and airflow control is at your finger tips with this digitally controlled Hot Air Gun. Quickly solder and de-solder DIP, BGA and SMT electronic components. Plus, be able to shrink, "Heat shrink tubing".

Details at Web Site Item# CSIHOTGUN-2

> Soldering Equipment & Supplies > Soldering Irons

#

|$89.00 1

High stability digital read-out bench power supplies featuring constant voltage and current outputs. Short- circuit and current limiting protection is provided. SMT PC boards and a built-in cooling fan help ensure reliable performance and long life.

•Source Effect: 5xlO"4=2mV

-Load Effect: 5xlO“4=2mV ( HOT

‘Ripple Coefficient:: <250uV \^ITEM!^

-Stepped Current: 30mA +/- 1mA *Both Models have a 1A/5VDC Fixed Output on the rear panel*

CSI3003X-5: 0-30v/0-3amp/l-4..$97.00/5+..$93.00

CSI5003X-5: 0-50v/0-3amp/l-4..$107.00/5+..$103.00

N Details at Web Site > Test Equipment > Power Supplies

As Low As

$93.00!

r s u.u

Circle #105 on the Reader Service Card.

Circuit Specialists, Inc. 220 S. Country Club Dr., Mesa, AZ 85210 800-528-1417 / 480-464-2485 / FAX: 480-464-5824

CircuitSpecialists.com CircuitSpecialists.com CircuitSpecialists.com

3M™ DataCom Cable Tester ^ f

Tbic unit ullnwc fnr mfmrdncT t^ctina ei

[UNBEATABLE PRICE

Onl

$49.

This unit allows for mapping, testing and troubleshooting of various lines, includ- ing installed data communications, phone wiring and coaxial cable runs. Performs multiple test on the following cable types, up to 1000 feet in length: Unshielded telephone cables with RJ-11 and RJ-45 connectors; Ethernet 10 (100) Base-T; Token Ring; EIA/TIA-568 A/B; AT&T 258a; USOC; 50 or 75 ohm Item# DT-2000 Coax with F or BNC connectors.

Originally Sold for $200.00!

Details at Web Site Includes: Holster, Case, 7 Remotes & Telecom Alligator Clips

C > Test Equipment > Specialty Test Equipment

RF Field Strength Analyzer

Compare at Over $2000!

The 3201 is a high quality hand-held RF Field Strength Analyzer with wide band reception ranging from 100kHz to 2060MHz.The 3201 is a compact & lightweight portable analyzer & is a must for RF Technicians. Ideal for testing, installing & maintenance of Mobile Telephone Comm systems, Cellular Phones, Cordless phones, paging systems, cable &Satellite TV as well as antenna installations.May also be used to locate hidden cameras using RF transmissions | Limited Time Offer\

New Fantastic Low Price: $1299.00!

A

WFM/NFM/AM/S SB modulated signals may be measured.

•Signal Levels up to 160Channels can be displayed simulaneously on the LCD •PLL tuning system for precise frequency measurement and tuning •Built-in Frequency Counter •LED Backlight LCD (192x192 dots)

•All fuctions are menu selected.

•RS232C with software for PC & printer

interface (Includes Antenna)

•Built-m speaker ' y

Item# 3201

Details at Web Site > Test Equipment > RF Test Equipment

BAG of LEDs DEAL Normal brightness LEDs now available in RED,

GREEN or YELLO\ in 3mm or 5mm sizes. Your choice. Each bag contains 100 of the same LEDs.

A

BAG-RED3MM $1.50 BAG-RED5MM $1.50

BAG-GREEN3MM $1.50 BAG-GREEN5MM $1.50

BAG-YELLOW3MM...$2.00 BAG-YELLOW5MM...$2.00

53B3SCS08...5mm Blue Super Bright 5G3UTB-2... 5mm Green

SB LED(1500max MCD) 1+ $0.70 /10+ $0.65 /100+ $0.60

SB LED(llOOmaxMCD) 1+ $0.45 /10+ $0.35 /100+ $0.30

5R3UT-2/R...5mm Red SB LED(3500max MCD) 1+ $0.25 /10+ $0.20 /100+ $0.15

LEDS Deal: 53BW3SCC08..5mmWMte SB LED(350Gmax MCD) 1+ $ 1 .69 /10+ $ 1 .49 /100+ $ 1 . 1 8

5Y3STC-2 5mm SB LED(3500max MCD) 1+ $0.25 /10+ $0.20 /100+ $0.15

Details at Web Site > Semiconductor Devices > LEDs, Displays & Lamps

^^C5001 2 Way FM Radio Tester/ FC6002 Radio Frequency Iracei^ The FC5001 2-way FM radio tester has the ability to I lock automatically and almost instantly on to any FM signal within its frequency range. The FC6002 radio frequency tracer is useful in locating stuck transmit- ters or bugging devices in a room or automobile. It excels at silent detecting RF signals for RF security and counter-surveillance applications.

FC5001: $99.00 1< ^ 1®©^% >|FC6002: $149.00 * |3L Details at Web Site > Test Equipment > RF Test Equipment J

\

SONY Super HAD CCD Color Weatherproof IR Camera

•Day & Night Auto Switch •Signal System: NTSC

•Image Sensor: 1/4" SONY Super HAD CCD •Effective Pixels: 510 x 492 •Horizontal Resolution: 420TV lines •Built-in Lens: 4.3mm •S/N Ratio: > 48dB (AGC OFF)

•Min. Illumination: OLux

t

l-4:$89.00 5+:$79.00

V.

Item# VC-819D

Details at Web Site

> Miniature Cameras(Board, Bullet, Mini’s, B/W, Color)

/SONY Super HAD CCD Color Weatherproof IR Cameras

Day & Night Auto Switch Signal System: NTSC

Image Sensor: 1/3" SONY Super HAD CCD Effective Pixels: 510 x 492 Horizontal Resolution: 480TV lines Built-in Lens: 6mm/F1.5 S/N Ratio: > 48dB

Min. Illumination: OLux Item# VC-827D Details at Web Site 1-4:$149.00 5+:$139.00

> Miniature Cameras(Board, Bullet, Mini’s, B/W, Color) ^

r SONY Super HAD CCD B/W Weatherproof IR Camera

•Day & Night Auto Switch •Signal System: EIA •Image Sensor: 1/3" SONY Super HAD CCD •Effective Pixels: 510 x 492 •Horizontal Resolution:

420TV lines

•Built-in Lens: 6mm/F 1.5 ^

•S/N Ratio: > 48dB •Min. Illumination: OLux

SONY Super HAD CCD™

equipped camera's feature dramatically improved light sensitivity

/SONY Super HAD CCD Color Camer a\

Item# VC-805 l-4:$69.00 5+:$65.00

Weather Proof •Signal System: NTSC •Image Sensor: 1/4" SONY Super HAD CCD •Effective Pixels: 510 x 492 •Horizontal Resolution: 420TV lines •Lens: 3.6mm •S/N Ratio: > 48dB •Min. Illumination: lLux/F1.2

Details at Web Site

> Miniature Cameras(Board,Bullit, Mini’s)

SONY Super HAD CCD Mini B/W Board Camera

Item# VC-103

Signal System: EIA •Image Sensor: 1/3" SONY Super"* HAD CCD

•Effective Pixels: 510 x 492 •Horizontal Resolution: 420TV Lines •Lens: 3.6mm/92° Angle of View •Min. Illumination: .05Lux/F1.2

l-4:$33.00 5+:$29.00

Details at Web Site

> Miniature Cameras

rsS&

l-4:$69.00 5+:$65.00 Item# VC-317D

Details at Web Site

> Miniature Cameras(Board,Bullit, Mini’s) J

pei

Pinhole Camera

Signal System: NTSC

Image Sensor: 1/3" SONY Super HAD CCD Effective Pixels: 510 x 492 Horizontal Resolution: 420TV lines Lens: 3.8mm/F2.0 Pinhole/900 Angle of View Min. Illumination: 0.8Lux/F1.2 S/N Ratio: > 48dB N O W : $ 4 8 . 9

Item# VC-8063CP J I $70, or -| i *rr

Details at Web Site > Miniature Cameras(Board,Bullit, Mini’s)

SONY Super HAD CCD Mini Color Camera

Signal System: NTSC

Image Sensor: 1/4" SONY Super HAD CCD Effective Pixels: 510 x 492 Horizontal Resolution: 380TV lines Lens: 3.6mm/92° Angle of View S/N Ratio: > 48dB Min. Illumination: l.OLux/F 1.2 White Balance: Auto tracking JN0WI$44.95

. Details at Web Site > Miniature Cameras(Board, Bullet, Mini’s, B/W, Color)

Item# VC-806B ■L1;$77i00 5i.$73.0r

0

V c

Visit our website for a complete listing of our offers. We have over 8,000 electronic items on line @ www.CircuitSpecialists.com. PC based data acquisition, industrial computers, loads of test equipment, optics, EC’s, transistors, diodes, resistors, potentiometers, motion control products, capacitors, miniature observation cameras, panel meters, chemicals for electronics, do it yourself printed circuit supplies for PCB fabrication, educational D.I.Y. kits, cooling fans, heat shrink, cable iesi&iotherwireJimidleingjtemsJJjiandtoolsjOT

Circuit Specialists, Inc. 220 S. Country Club Dr., Mesa, AZ 85210

800-528-1417 / 480-464-2485 / FAX: 480-464-5824

Y

y

Circle #105 on the Reader Service Card.

Our USB oscilloscope is small, elegant and requires no power supply. All oscilloscope controls are managed through a point-and-click PC interface. Common scope features including trigger settings, waveform measurements (MIN, MAX, frequency, period), ability to save customized setups, and BMP screen captures are standard in the software. Special features include 3 cursor functions with the option to snap to the waveform. Easy to use with your latest BASIC Stamp® project.

□rder online 24--hour5 a day at uuLuuu.parallaH.com or call our Sales Department toll-Free 888-812-1084- [monday -Friday, 7 am to 5 pm, PT],

luulj Lu.parallaH.com

BR5IC Stamp is a registered trademark oF Paralian, Inc.

Digital Oscilloscope Technical Specifications:

1 Ms/s Max Sample Rate with One Channel

500 Ks/s Sample Rate with Two Channels

20 Vpp Maximum Input for Channels 1 and 2

200 kHz Bandwidth

8-Bit Vertical Resolution

1 M Ohm Input Impedance

Variable Trigger voltage on Channels 1 and 2

Auto and Normal Trigger Modes

USB 1.1 Support

Size: 5 x 2.25 x 1.5 in (12.7 x 5.7 x 3.8 cm)

Circle #154 on the Reader Service Card.